From 366a4074c9e33b5f8e3b3c8851b1eafd1433bc80 Mon Sep 17 00:00:00 2001 From: Andrew Ryan Lazarus Date: Thu, 19 Sep 2013 11:43:09 -0700 Subject: [PATCH] Fix docs: 2x missing do; fix factory_girl method --- README.md | 2 +- lib/state_machine/machine.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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