Module: AASM::Persistence::MongoidPersistence::ClassMethods

Defined in:
lib/aasm/persistence/mongoid_persistence.rb

Instance Method Summary collapse

Instance Method Details

#aasm_create_scope(state_machine_name, scope_name) ⇒ Object


42
43
44
45
46
47
48
49
50
# File 'lib/aasm/persistence/mongoid_persistence.rb', line 42

def aasm_create_scope(state_machine_name, scope_name)
  scope_options = lambda {
    send(
      :where,
      { aasm(state_machine_name).attribute_name.to_sym => scope_name.to_s }
    )
  }
  send(:scope, scope_name, scope_options)
end