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")
Written by Jean-Richard Lai
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#State_event
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#