diff --git a/README.md b/README.md index 511c25a0..0c454d51 100644 --- a/README.md +++ b/README.md @@ -1211,7 +1211,7 @@ The following caveats should be noted when using state_machine: # Re-initialize in FactoryGirl FactoryGirl.define do factory :vehicle do - after_build {|user| user.send(:initialize_state_machines, :dynamic => :force)} + after(:build) {|user| user.send(:initialize_state_machines, :dynamic => :force)} end end diff --git a/lib/state_machine/machine.rb b/lib/state_machine/machine.rb index 6aa6eae0..249baf89 100644 --- a/lib/state_machine/machine.rb +++ b/lib/state_machine/machine.rb @@ -156,7 +156,7 @@ module StateMachine # actually stored as nil): # # class Vehicle - # state_machine :initial => :pending + # state_machine :initial => :pending do # after_transition :pending => :parked, :do => :track_initial_transition # # event :park do @@ -175,7 +175,7 @@ module StateMachine # actually stored as nil): # # class Vehicle < ActiveRecord::Base - # state_machine :initial => :pending + # state_machine :initial => :pending do # after_transition :pending => :parked, :do => :track_initial_transition # # event :park do