Displaying 1 result from an estimated 1 matches for "associated_model".
2007 Jul 23
2
Acts_As_Ferret: disable_ferret and Callbacks
...r validation (they''re all instantiated around the same time). I
recently added a conditional call to disable ferret provided a flag and
I''m finding these callbacks aren''t quite working right.
Here''s a code sample:
class Model < ActiveRecord::Base
has_one :associated_model # This model will fill in some fields upon
it''s own validation
def save_with_activation_handling!
if active? # This part works
self.activated_at = Time.now
else
disable_ferret :once
self.activated_at = nil
end
save_without_activation_handling!
end...