1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

added after_commit hook

This commit is contained in:
Sebastian Cohnen 2013-10-01 13:03:51 +02:00
parent 86c24c4082
commit 9f9bb07bc4

View file

@ -132,9 +132,16 @@ module AASM
end
def aasm_fire_event(name, options, *args)
self.class.transaction(:requires_new => true) do
success = self.class.transaction(:requires_new => true) do
super
end
if success
new_state = aasm.state_object_for_name(aasm.current_state)
new_state.fire_callbacks(:after_commit, self)
end
success
end
end # InstanceMethods