-
Notifications
You must be signed in to change notification settings - Fork 0
/
callbacks.txt
51 lines (45 loc) · 1.3 KB
/
callbacks.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
callbacks
AASM 3
begin
old_state exit # old? should be deprecated -> use old_state.before_exit instead
event before
old_state before_exit
new_state before_enter
new_state enter # old? should be deprecated -> use new_state.before_enter instead
...update state...
transition guard
event guard
transition on_transition
event success # if persist successful
old_state after_exit
new_state after_enter
event after
rescue
event error
end
AASM 4
todo
done
- move event.before before everything else
- move old_state.before_exit before old_state.exit
- move event.guard before transition.guard
- fire guards before running state callbacks (test run)
begin
event before
event guard # test run
transition guard # test run
old_state before_exit
old_state exit
new_state before_enter
new_state enter
event guard
transition guard
transition on_transition
...update state...
event success # if persist successful
old_state after_exit
new_state after_enter
event after
rescue
event error
end