Last Updated: February 25, 2016
·
517
· jrichardlai

Skipping callback of state_event in Rails 3.0

callback_name = "fire_#{state}_state_after_save"
self.class.skip_callback(:save, :after, "(#{callback_name})")
save
self.class.set_callback(:save, :after, callback_name, :if => "state_event_if_#{state}_changed")