README.rdoc in state_machine-0.3.0 vs README.rdoc in state_machine-0.3.1
- old
+ new
@@ -42,11 +42,11 @@
* Initial states
* Transition callbacks
* Conditional transitions
class Vehicle < ActiveRecord::Base
- state_machine :state, :initial => 'idling' do
+ state_machine :state, :initial => 'parked' do
before_transition :from => %w(parked idling), :do => :put_on_seatbelt
after_transition :to => 'parked', :do => lambda {|vehicle| vehicle.update_attribute(:seatbelt_on, false)}
after_transition :on => 'crash', :do => :tow!
after_transition :on => 'repair', :do => :fix!
@@ -125,10 +125,10 @@
end
class Vehicle < ActiveRecord::Base
belongs_to :state, :class_name => 'VehicleState'
- state_machine :state, :initial => 'idling' do
+ state_machine :state, :initial => 'parked' do
...
event :park do
transition :to => 'parked', :from => %w(idling first_gear)
end