lib/aasm.rb in runcoderun-aasm-2.0.2.3 vs lib/aasm.rb in runcoderun-aasm-2.0.2.4
- old
+ new
@@ -3,11 +3,11 @@
require File.join(File.dirname(__FILE__), 'state_machine')
require File.join(File.dirname(__FILE__), 'persistence')
module AASM
def self.Version
- '2.0.2.3'
+ '2.0.2.4'
end
class InvalidTransition < RuntimeError
end
@@ -124,19 +124,19 @@
aasm_state_object_for_state(aasm_current_state).call_action(:exit, self)
new_state = self.class.aasm_events[name].fire(self, *args)
unless new_state.nil?
- aasm_state_object_for_state(new_state).call_action(:enter, self)
-
persist_successful = true
if persist
persist_successful = set_aasm_current_state_with_persistence(new_state)
- self.class.aasm_events[name].execute_success_callback(self) if persist_successful
else
self.aasm_current_state = new_state
- self.class.aasm_events[name].execute_success_callback(self)
end
+
+ self.class.aasm_events[name].execute_success_callback(self) if persist_successful
+
+ aasm_state_object_for_state(new_state).call_action(:enter, self)
if persist_successful
self.aasm_event_fired(self.aasm_current_state, new_state) if self.respond_to?(:aasm_event_fired)
else
self.aasm_event_failed(name) if self.respond_to?(:aasm_event_failed)