Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ begin
transition guards
old_state before_exit
old_state exit
after_all_transitions
transition after
after_all_transitions
new_state before_enter
new_state enter
...update state...
Expand Down
2 changes: 1 addition & 1 deletion lib/aasm/core/transition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def allowed?(obj, *args)
end

def execute(obj, *args)
invoke_callbacks_compatible_with_guard(event.state_machine.global_callbacks[:after_all_transitions], obj, args)
invoke_callbacks_compatible_with_guard(@after, obj, args)
invoke_callbacks_compatible_with_guard(event.state_machine.global_callbacks[:after_all_transitions], obj, args)
end

def ==(obj)
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/callbacks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
expect(callback).to receive(:exit_open).once.ordered
# expect(callback).to receive(:event_guard).once.ordered.and_return(true)
# expect(callback).to receive(:transition_guard).once.ordered.and_return(true)
expect(callback).to receive(:after_all_transitions).once.ordered
expect(callback).to receive(:after_transition).once.ordered
expect(callback).to receive(:after_all_transitions).once.ordered
expect(callback).to receive(:before_enter_closed).once.ordered
expect(callback).to receive(:enter_closed).once.ordered
expect(callback).to receive(:aasm_write_state).once.ordered.and_return(true) # this is when the state changes
Expand Down Expand Up @@ -111,8 +111,8 @@
expect(callback).to receive(:exit_open).once.ordered
# expect(callback).to receive(:event_guard).once.ordered.and_return(true)
# expect(callback).to receive(:transition_guard).once.ordered.and_return(true)
expect(callback).to receive(:after_all_transitions).once.ordered
expect(callback).to receive(:after_transition).once.ordered
expect(callback).to receive(:after_all_transitions).once.ordered
expect(callback).to receive(:before_enter_closed).once.ordered
expect(callback).to receive(:enter_closed).once.ordered
expect(callback).to receive(:aasm_write_state).once.ordered.and_return(true) # this is when the state changes
Expand Down