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
A potentially even better/cleaner potential way than the answers proposed is to overwrite the accessor, like this:
def status self['name_of_var'] || 'desired_default_value' end
See "Overwriting default accessors" in the ActiveRecord::Base documentation and more from StackOverflow on using self.