I\'m trying to find the best way to set default values for objects in Rails.
The best I can think of is to set the default value in the new method in
new
You can override the constructor for the ActiveRecord model.
Like this:
def initialize(*args) super(*args) self.attribute_that_needs_default_value ||= default_value self.attribute_that_needs_another_default_value ||= another_default_value #ad nauseum end