Module: ActsAsList::Mongoid

Defined in:
lib/mongoid/acts_as_list.rb

Defined Under Namespace

Modules: ClassMethods, Fields, InitializerMethods, InstanceMethods, Triggers

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.default_position_columnObject

Returns the value of attribute default_position_column.



8
9
10
# File 'lib/mongoid/acts_as_list.rb', line 8

def default_position_column
  @default_position_column
end

Class Method Details

.included(klass) ⇒ Object



11
12
13
14
15
16
# File 'lib/mongoid/acts_as_list.rb', line 11

def self.included(klass)
  klass.extend InitializerMethods
  key = self.default_position_column || :position
  klass.field key, :type => Integer
  klass.acts_as_list :column => key.to_s
end