Module: AASM::Persistence::MongoidPersistence::NamedScopeMethods

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

Instance Method Summary collapse

Instance Method Details

#aasm_state_with_named_scope(name, options = {}) ⇒ Object



240
241
242
243
# File 'lib/aasm/persistence/mongoid_persistence.rb', line 240

def aasm_state_with_named_scope name, options = {}
  aasm_state_without_named_scope name, options
  self.named_scope name, :conditions => { "#{table_name}.#{self.aasm_column}" => name.to_s} unless self.respond_to?(name)
end