state_machine 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. data/.gitignore +11 -0
  2. data/.travis.yml +16 -0
  3. data/.yardopts +5 -0
  4. data/Appraisals +260 -0
  5. data/CHANGELOG.rdoc +15 -0
  6. data/Gemfile +3 -0
  7. data/README.rdoc +156 -29
  8. data/Rakefile +31 -57
  9. data/gemfiles/active_model-3.0.0.gemfile +7 -0
  10. data/gemfiles/active_model-3.0.0.gemfile.lock +32 -0
  11. data/gemfiles/active_model-3.0.5.gemfile +7 -0
  12. data/gemfiles/active_model-3.0.5.gemfile.lock +32 -0
  13. data/gemfiles/active_record-2.0.0.gemfile +8 -0
  14. data/gemfiles/active_record-2.0.0.gemfile.lock +30 -0
  15. data/gemfiles/active_record-2.0.5.gemfile +8 -0
  16. data/gemfiles/active_record-2.0.5.gemfile.lock +30 -0
  17. data/gemfiles/active_record-2.1.0.gemfile +8 -0
  18. data/gemfiles/active_record-2.1.0.gemfile.lock +30 -0
  19. data/gemfiles/active_record-2.1.2.gemfile +8 -0
  20. data/gemfiles/active_record-2.1.2.gemfile.lock +30 -0
  21. data/gemfiles/active_record-2.2.3.gemfile +8 -0
  22. data/gemfiles/active_record-2.2.3.gemfile.lock +30 -0
  23. data/gemfiles/active_record-2.3.12.gemfile +8 -0
  24. data/gemfiles/active_record-2.3.12.gemfile.lock +30 -0
  25. data/gemfiles/active_record-3.0.0.gemfile +8 -0
  26. data/gemfiles/active_record-3.0.0.gemfile.lock +44 -0
  27. data/gemfiles/active_record-3.0.5.gemfile +8 -0
  28. data/gemfiles/active_record-3.0.5.gemfile.lock +43 -0
  29. data/gemfiles/data_mapper-0.10.2.gemfile +12 -0
  30. data/gemfiles/data_mapper-0.10.2.gemfile.lock +45 -0
  31. data/gemfiles/data_mapper-0.9.11.gemfile +12 -0
  32. data/gemfiles/data_mapper-0.9.11.gemfile.lock +47 -0
  33. data/gemfiles/data_mapper-0.9.4.gemfile +12 -0
  34. data/gemfiles/data_mapper-0.9.4.gemfile.lock +61 -0
  35. data/gemfiles/data_mapper-0.9.7.gemfile +12 -0
  36. data/gemfiles/data_mapper-0.9.7.gemfile.lock +57 -0
  37. data/gemfiles/data_mapper-1.0.0.gemfile +12 -0
  38. data/gemfiles/data_mapper-1.0.0.gemfile.lock +53 -0
  39. data/gemfiles/data_mapper-1.0.1.gemfile +12 -0
  40. data/gemfiles/data_mapper-1.0.1.gemfile.lock +53 -0
  41. data/gemfiles/data_mapper-1.0.2.gemfile +12 -0
  42. data/gemfiles/data_mapper-1.0.2.gemfile.lock +53 -0
  43. data/gemfiles/data_mapper-1.1.0.gemfile +12 -0
  44. data/gemfiles/data_mapper-1.1.0.gemfile.lock +51 -0
  45. data/gemfiles/default.gemfile +7 -0
  46. data/gemfiles/default.gemfile.lock +24 -0
  47. data/gemfiles/mongo_mapper-0.5.5.gemfile +8 -0
  48. data/gemfiles/mongo_mapper-0.5.5.gemfile.lock +33 -0
  49. data/gemfiles/mongo_mapper-0.5.8.gemfile +8 -0
  50. data/gemfiles/mongo_mapper-0.5.8.gemfile.lock +33 -0
  51. data/gemfiles/mongo_mapper-0.6.0.gemfile +8 -0
  52. data/gemfiles/mongo_mapper-0.6.0.gemfile.lock +33 -0
  53. data/gemfiles/mongo_mapper-0.6.10.gemfile +8 -0
  54. data/gemfiles/mongo_mapper-0.6.10.gemfile.lock +33 -0
  55. data/gemfiles/mongo_mapper-0.7.0.gemfile +8 -0
  56. data/gemfiles/mongo_mapper-0.7.0.gemfile.lock +33 -0
  57. data/gemfiles/mongo_mapper-0.7.5.gemfile +8 -0
  58. data/gemfiles/mongo_mapper-0.7.5.gemfile.lock +36 -0
  59. data/gemfiles/mongo_mapper-0.8.0.gemfile +10 -0
  60. data/gemfiles/mongo_mapper-0.8.0.gemfile.lock +40 -0
  61. data/gemfiles/mongo_mapper-0.8.3.gemfile +10 -0
  62. data/gemfiles/mongo_mapper-0.8.3.gemfile.lock +40 -0
  63. data/gemfiles/mongo_mapper-0.8.4.gemfile +8 -0
  64. data/gemfiles/mongo_mapper-0.8.4.gemfile.lock +38 -0
  65. data/gemfiles/mongo_mapper-0.8.6.gemfile +8 -0
  66. data/gemfiles/mongo_mapper-0.8.6.gemfile.lock +38 -0
  67. data/gemfiles/mongo_mapper-0.9.0.gemfile +7 -0
  68. data/gemfiles/mongo_mapper-0.9.0.gemfile.lock +41 -0
  69. data/gemfiles/mongoid-2.0.0.gemfile +7 -0
  70. data/gemfiles/mongoid-2.0.0.gemfile.lock +42 -0
  71. data/gemfiles/mongoid-2.1.4.gemfile +7 -0
  72. data/gemfiles/mongoid-2.1.4.gemfile.lock +40 -0
  73. data/gemfiles/sequel-2.11.0.gemfile +8 -0
  74. data/gemfiles/sequel-2.11.0.gemfile.lock +28 -0
  75. data/gemfiles/sequel-2.12.0.gemfile +8 -0
  76. data/gemfiles/sequel-2.12.0.gemfile.lock +28 -0
  77. data/gemfiles/sequel-2.8.0.gemfile +8 -0
  78. data/gemfiles/sequel-2.8.0.gemfile.lock +28 -0
  79. data/gemfiles/sequel-3.0.0.gemfile +8 -0
  80. data/gemfiles/sequel-3.0.0.gemfile.lock +28 -0
  81. data/gemfiles/sequel-3.13.0.gemfile +8 -0
  82. data/gemfiles/sequel-3.13.0.gemfile.lock +28 -0
  83. data/gemfiles/sequel-3.14.0.gemfile +8 -0
  84. data/gemfiles/sequel-3.14.0.gemfile.lock +28 -0
  85. data/gemfiles/sequel-3.23.0.gemfile +8 -0
  86. data/gemfiles/sequel-3.23.0.gemfile.lock +28 -0
  87. data/gemfiles/sequel-3.24.0.gemfile +8 -0
  88. data/gemfiles/sequel-3.24.0.gemfile.lock +28 -0
  89. data/lib/state_machine/event.rb +13 -90
  90. data/lib/state_machine/helper_module.rb +17 -0
  91. data/lib/state_machine/integrations/active_model.rb +35 -0
  92. data/lib/state_machine/integrations/active_record.rb +41 -2
  93. data/lib/state_machine/integrations/data_mapper.rb +17 -2
  94. data/lib/state_machine/integrations/mongo_mapper.rb +34 -7
  95. data/lib/state_machine/integrations/mongoid.rb +34 -26
  96. data/lib/state_machine/integrations/mongoid/versions.rb +29 -3
  97. data/lib/state_machine/integrations/sequel.rb +22 -72
  98. data/lib/state_machine/integrations/sequel/versions.rb +87 -6
  99. data/lib/state_machine/machine.rb +279 -19
  100. data/lib/state_machine/state.rb +2 -2
  101. data/lib/state_machine/state_context.rb +133 -0
  102. data/lib/state_machine/version.rb +3 -0
  103. data/state_machine.gemspec +22 -0
  104. data/test/test_helper.rb +1 -3
  105. data/test/unit/branch_test.rb +1 -3
  106. data/test/unit/event_collection_test.rb +3 -3
  107. data/test/unit/event_test.rb +1 -3
  108. data/test/unit/helper_module_test.rb +17 -0
  109. data/test/unit/integrations/active_model_test.rb +0 -4
  110. data/test/unit/integrations/active_record_test.rb +50 -9
  111. data/test/unit/integrations/data_mapper_test.rb +267 -253
  112. data/test/unit/integrations/mongo_mapper_test.rb +47 -15
  113. data/test/unit/integrations/mongoid_test.rb +50 -8
  114. data/test/unit/integrations/sequel_test.rb +10 -6
  115. data/test/unit/machine_test.rb +206 -25
  116. data/test/unit/state_context_test.rb +421 -0
  117. data/test/unit/state_test.rb +20 -3
  118. metadata +303 -128
  119. data/lib/state_machine/condition_proxy.rb +0 -94
  120. data/test/unit/condition_proxy_test.rb +0 -328
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "sqlite3-ruby", "1.3.1"
6
+ gem "sequel", "2.12.0"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,28 @@
1
+ PATH
2
+ remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
3
+ specs:
4
+ state_machine (1.0.1)
5
+
6
+ GEM
7
+ remote: http://www.rubygems.org/
8
+ specs:
9
+ appraisal (0.3.8)
10
+ bundler
11
+ rake
12
+ rake (0.9.2)
13
+ rcov (0.9.10)
14
+ ruby-graphviz (1.0.0)
15
+ sequel (2.12.0)
16
+ sqlite3-ruby (1.3.1)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ appraisal (~> 0.3.8)
23
+ rake
24
+ rcov
25
+ ruby-graphviz (~> 1.0)
26
+ sequel (= 2.12.0)
27
+ sqlite3-ruby (= 1.3.1)
28
+ state_machine!
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "sqlite3-ruby", "1.3.1"
6
+ gem "sequel", "2.8.0"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,28 @@
1
+ PATH
2
+ remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
3
+ specs:
4
+ state_machine (1.0.1)
5
+
6
+ GEM
7
+ remote: http://www.rubygems.org/
8
+ specs:
9
+ appraisal (0.3.8)
10
+ bundler
11
+ rake
12
+ rake (0.9.2)
13
+ rcov (0.9.10)
14
+ ruby-graphviz (1.0.0)
15
+ sequel (2.8.0)
16
+ sqlite3-ruby (1.3.1)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ appraisal (~> 0.3.8)
23
+ rake
24
+ rcov
25
+ ruby-graphviz (~> 1.0)
26
+ sequel (= 2.8.0)
27
+ sqlite3-ruby (= 1.3.1)
28
+ state_machine!
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "sqlite3-ruby", "1.3.1"
6
+ gem "sequel", "3.0.0"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,28 @@
1
+ PATH
2
+ remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
3
+ specs:
4
+ state_machine (1.0.1)
5
+
6
+ GEM
7
+ remote: http://www.rubygems.org/
8
+ specs:
9
+ appraisal (0.3.8)
10
+ bundler
11
+ rake
12
+ rake (0.9.2)
13
+ rcov (0.9.10)
14
+ ruby-graphviz (1.0.0)
15
+ sequel (3.0.0)
16
+ sqlite3-ruby (1.3.1)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ appraisal (~> 0.3.8)
23
+ rake
24
+ rcov
25
+ ruby-graphviz (~> 1.0)
26
+ sequel (= 3.0.0)
27
+ sqlite3-ruby (= 1.3.1)
28
+ state_machine!
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "sqlite3-ruby", "1.3.1"
6
+ gem "sequel", "3.13.0"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,28 @@
1
+ PATH
2
+ remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
3
+ specs:
4
+ state_machine (1.0.1)
5
+
6
+ GEM
7
+ remote: http://www.rubygems.org/
8
+ specs:
9
+ appraisal (0.3.8)
10
+ bundler
11
+ rake
12
+ rake (0.9.2)
13
+ rcov (0.9.10)
14
+ ruby-graphviz (1.0.0)
15
+ sequel (3.13.0)
16
+ sqlite3-ruby (1.3.1)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ appraisal (~> 0.3.8)
23
+ rake
24
+ rcov
25
+ ruby-graphviz (~> 1.0)
26
+ sequel (= 3.13.0)
27
+ sqlite3-ruby (= 1.3.1)
28
+ state_machine!
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "sqlite3-ruby", "1.3.1"
6
+ gem "sequel", "3.14.0"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,28 @@
1
+ PATH
2
+ remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
3
+ specs:
4
+ state_machine (1.0.1)
5
+
6
+ GEM
7
+ remote: http://www.rubygems.org/
8
+ specs:
9
+ appraisal (0.3.8)
10
+ bundler
11
+ rake
12
+ rake (0.9.2)
13
+ rcov (0.9.10)
14
+ ruby-graphviz (1.0.0)
15
+ sequel (3.14.0)
16
+ sqlite3-ruby (1.3.1)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ appraisal (~> 0.3.8)
23
+ rake
24
+ rcov
25
+ ruby-graphviz (~> 1.0)
26
+ sequel (= 3.14.0)
27
+ sqlite3-ruby (= 1.3.1)
28
+ state_machine!
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "sqlite3-ruby", "1.3.1"
6
+ gem "sequel", "3.23.0"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,28 @@
1
+ PATH
2
+ remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
3
+ specs:
4
+ state_machine (1.0.1)
5
+
6
+ GEM
7
+ remote: http://www.rubygems.org/
8
+ specs:
9
+ appraisal (0.3.8)
10
+ bundler
11
+ rake
12
+ rake (0.9.2)
13
+ rcov (0.9.10)
14
+ ruby-graphviz (1.0.0)
15
+ sequel (3.23.0)
16
+ sqlite3-ruby (1.3.1)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ appraisal (~> 0.3.8)
23
+ rake
24
+ rcov
25
+ ruby-graphviz (~> 1.0)
26
+ sequel (= 3.23.0)
27
+ sqlite3-ruby (= 1.3.1)
28
+ state_machine!
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://www.rubygems.org"
4
+
5
+ gem "sqlite3-ruby", "1.3.1"
6
+ gem "sequel", "3.24.0"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,28 @@
1
+ PATH
2
+ remote: /home/aaron/Projects/Personal/pluginaweek/state_machine
3
+ specs:
4
+ state_machine (1.0.1)
5
+
6
+ GEM
7
+ remote: http://www.rubygems.org/
8
+ specs:
9
+ appraisal (0.3.8)
10
+ bundler
11
+ rake
12
+ rake (0.9.2)
13
+ rcov (0.9.10)
14
+ ruby-graphviz (1.0.0)
15
+ sequel (3.24.0)
16
+ sqlite3-ruby (1.3.1)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ appraisal (~> 0.3.8)
23
+ rake
24
+ rcov
25
+ ruby-graphviz (~> 1.0)
26
+ sequel (= 3.24.0)
27
+ sqlite3-ruby (= 1.3.1)
28
+ state_machine!
@@ -84,96 +84,19 @@ module StateMachine
84
84
  # Creates a new transition that determines what to change the current state
85
85
  # to when this event fires.
86
86
  #
87
- # == Defining transitions
88
- #
89
- # The options for a new transition uses the Hash syntax to map beginning
90
- # states to ending states. For example,
91
- #
92
- # transition :parked => :idling, :idling => :first_gear
93
- #
94
- # In this case, when the event is fired, this transition will cause the
95
- # state to be +idling+ if it's current state is +parked+ or +first_gear+
96
- # if it's current state is +idling+.
97
- #
98
- # To help define these implicit transitions, a set of helpers are available
99
- # for slightly more complex matching:
100
- # * <tt>all</tt> - Matches every state in the machine
101
- # * <tt>all - [:parked, :idling, ...]</tt> - Matches every state except those specified
102
- # * <tt>any</tt> - An alias for +all+ (matches every state in the machine)
103
- # * <tt>same</tt> - Matches the same state being transitioned from
104
- #
105
- # See StateMachine::MatcherHelpers for more information.
106
- #
107
- # Examples:
108
- #
109
- # transition all => nil # Transitions to nil regardless of the current state
110
- # transition all => :idling # Transitions to :idling regardless of the current state
111
- # transition all - [:idling, :first_gear] => :idling # Transitions every state but :idling and :first_gear to :idling
112
- # transition nil => :idling # Transitions to :idling from the nil state
113
- # transition :parked => :idling # Transitions to :idling if :parked
114
- # transition [:parked, :stalled] => :idling # Transitions to :idling if :parked or :stalled
115
- #
116
- # transition :parked => same # Loops :parked back to :parked
117
- # transition [:parked, :stalled] => same # Loops either :parked or :stalled back to the same state
118
- # transition all - :parked => same # Loops every state but :parked back to the same state
119
- #
120
- # # Transitions to :idling if :parked, :first_gear if :idling, or :second_gear if :first_gear
121
- # transition :parked => :idling, :idling => :first_gear, :first_gear => :second_gear
122
- #
123
- # == Verbose transitions
124
- #
125
- # Transitions can also be defined use an explicit set of deprecated
126
- # configuration options:
127
- # * <tt>:from</tt> - A state or array of states that can be transitioned from.
128
- # If not specified, then the transition can occur for *any* state.
129
- # * <tt>:to</tt> - The state that's being transitioned to. If not specified,
130
- # then the transition will simply loop back (i.e. the state will not change).
131
- # * <tt>:except_from</tt> - A state or array of states that *cannot* be
132
- # transitioned from.
133
- #
134
- # Examples:
135
- #
136
- # transition :to => nil
137
- # transition :to => :idling
138
- # transition :except_from => [:idling, :first_gear], :to => :idling
139
- # transition :from => nil, :to => :idling
140
- # transition :from => [:parked, :stalled], :to => :idling
141
- #
142
- # transition :from => :parked
143
- # transition :from => [:parked, :stalled]
144
- # transition :except_from => :parked
145
- #
146
- # Notice that the above examples are the verbose equivalent of the examples
147
- # described initially.
148
- #
149
- # == Conditions
150
- #
151
- # In addition to the state requirements for each transition, a condition
152
- # can also be defined to help determine whether that transition is
153
- # available. These options will work on both the normal and verbose syntax.
154
- #
155
- # Configuration options:
156
- # * <tt>:if</tt> - A method, proc or string to call to determine if the
157
- # transition should occur (e.g. :if => :moving?, or :if => lambda {|vehicle| vehicle.speed > 60}).
158
- # The condition should return or evaluate to true or false.
159
- # * <tt>:unless</tt> - A method, proc or string to call to determine if the
160
- # transition should not occur (e.g. :unless => :stopped?, or :unless => lambda {|vehicle| vehicle.speed <= 60}).
161
- # The condition should return or evaluate to true or false.
162
- #
163
- # Examples:
164
- #
165
- # transition :parked => :idling, :if => :moving?
166
- # transition :parked => :idling, :unless => :stopped?
167
- # transition :idling => :first_gear, :first_gear => :second_gear, :if => :seatbelt_on?
168
- #
169
- # transition :from => :parked, :to => :idling, :if => :moving?
170
- # transition :from => :parked, :to => :idling, :unless => :stopped?
171
- #
172
- # == Order of operations
173
- #
174
- # Transitions are evaluated in the order in which they're defined. As a
175
- # result, if more than one transition applies to a given object, then the
176
- # first transition that matches will be performed.
87
+ # Since this transition is being defined within an event context, you do
88
+ # *not* need to specify the <tt>:on</tt> option for the transition. For
89
+ # example:
90
+ #
91
+ # state_machine do
92
+ # event :ignite do
93
+ # transition :parked => :idling, :idling => same, :if => :seatbelt_on? # Transitions to :idling if seatbelt is on
94
+ # transition all => :parked, :unless => :seatbelt_on? # Transitions to :parked if seatbelt is off
95
+ # end
96
+ # end
97
+ #
98
+ # See StateMachine::Machine#transition for a description of the possible
99
+ # configurations for defining transitions.
177
100
  def transition(options)
178
101
  raise ArgumentError, 'Must specify as least one transition requirement' if options.empty?
179
102
 
@@ -0,0 +1,17 @@
1
+ module StateMachine
2
+ # Represents a type of module that defines instance / class methods for a
3
+ # state machine
4
+ class HelperModule < Module #:nodoc:
5
+ def initialize(machine, kind)
6
+ @machine = machine
7
+ @kind = kind
8
+ end
9
+
10
+ # Provides a human-readable description of the module
11
+ def to_s
12
+ owner_class = @machine.owner_class
13
+ owner_class_name = owner_class.name && !owner_class.name.empty? ? owner_class.name : owner_class.to_s
14
+ "#{owner_class_name} #{@machine.name.inspect} #{@kind} helpers"
15
+ end
16
+ end
17
+ end
@@ -51,6 +51,40 @@ module StateMachine
51
51
  # end
52
52
  # end
53
53
  #
54
+ # == Validations
55
+ #
56
+ # As mentioned in StateMachine::Machine#state, you can define behaviors,
57
+ # like validations, that only execute for certain states. One *important*
58
+ # caveat here is that, due to a constraint in ActiveModel's validation
59
+ # framework, custom validators will not work as expected when defined to run
60
+ # in multiple states. For example:
61
+ #
62
+ # class Vehicle
63
+ # include ActiveModel::Validations
64
+ #
65
+ # state_machine do
66
+ # ...
67
+ # state :first_gear, :second_gear do
68
+ # validate :speed_is_legal
69
+ # end
70
+ # end
71
+ # end
72
+ #
73
+ # In this case, the <tt>:speed_is_legal</tt> validation will only get run
74
+ # for the <tt>:second_gear</tt> state. To avoid this, you can define your
75
+ # custom validation like so:
76
+ #
77
+ # class Vehicle
78
+ # include ActiveModel::Validations
79
+ #
80
+ # state_machine do
81
+ # ...
82
+ # state :first_gear, :second_gear do
83
+ # validate {|vehicle| vehicle.speed_is_legal}
84
+ # end
85
+ # end
86
+ # end
87
+ #
54
88
  # == Validation errors
55
89
  #
56
90
  # In order to hook in validation support for your model, the
@@ -380,6 +414,7 @@ module StateMachine
380
414
 
381
415
  # Initializes class-level extensions and defaults for this machine
382
416
  def after_initialize
417
+ super
383
418
  load_locale
384
419
  load_observer_extensions
385
420
  add_default_callbacks