lib/acts_as_state_machine.rb
# Configuration options are
#
# * +column+ - specifies the column name to use for keeping the state (default: state)
# * +initial+ - specifies an initial state for newly created objects (required)
Configuration options are
+column+ - specifies the column name to use for keeping the state (default: state)
+initial+ - specifies an initial state for newly created objects (required)
Configuration options are + column + - specifies the column name to use for keeping the state ( default : state ) + initial + - specifies an initial state for newly created objects ( required )
def acts_as_state_machine(opts)
          self.extend(ClassMethods)
          raise NoInitialState unless opts[:initial]
          write_inheritable_attribute :states, {}
          write_inheritable_attribute :initial_state, opts[:initial]
          write_inheritable_attribute :transition_table, {}
          write_inheritable_attribute :event_table, {}
          write_inheritable_attribute :state_column, opts[:column] || 'state'
          class_inheritable_reader    :initial_state
          class_inheritable_reader    :state_column
          class_inheritable_reader    :transition_table
          class_inheritable_reader    :event_table
          self.send(:include, ScottBarron::Acts::StateMachine::InstanceMethods)
          before_create               :set_initial_state
          after_create                :run_initial_state_actions
        end
def acts_as_state_machine ( opts ) self . extend ( ClassMethods ) raise NoInitialState unless opts [ :initial ] write_inheritable_attribute :states , { } write_inheritable_attribute :initial_state , opts [ :initial ] write_inheritable_attribute :transition_table , { } write_inheritable_attribute :event_table , { } write_inheritable_attribute :state_column , opts [ :column ] || 'state' class_inheritable_reader :initial_state class_inheritable_reader :state_column class_inheritable_reader :transition_table class_inheritable_reader :event_table self . send ( :include , ScottBarron :: Acts :: StateMachine :: InstanceMethods ) before_create :set_initial_state after_create :run_initial_state_actions end
Configuration options are
 +column+ - specifies the column name to use for keeping the state (default: state)
 +initial+ - specifies an initial state for newly created objects (required)
Configuration options are + column + - specifies the column name to use for keeping the state ( default : state ) + initial + - specifies an initial state for newly created objects ( required )
opts
<not_specific>