Module: ActiveRecord::EdgeStateMachine::ClassMethods

Defined in:
lib/active_record/edge-state-machine.rb

Instance Method Summary collapse

Instance Method Details

#add_scope(state, machine_name) ⇒ Object



72
73
74
75
# File 'lib/active_record/edge-state-machine.rb', line 72

def add_scope(state, machine_name)
  machine = state_machines[machine_name]
  scope state.name, where(machine.persisted_variable_name.to_sym => state.name.to_s)
end