I have an after_initialize method that I only want to call if I'm not updating a record. For example, something like the following:
after_initialize :set_some_name, :unless => :updating?
For example, Task.find(123).title
should call the after_initialize
method. Task.find(123).save!(:title => "something")
should not call the after_initialize
method.
Of course the "updating?" method doesn't exist in Rails. Is there an equivalent method or a way to do so?