Class: Mongoid::Orderable::Configuration
- Inherits:
-
Object
- Object
- Mongoid::Orderable::Configuration
- Defined in:
- lib/mongoid/orderable/configuration.rb
Constant Summary collapse
- CONFIG_OPTIONS =
%w(column scope foreign_key inherited base index default).map(&:to_sym)
- FIELD_OPTIONS =
%w(as).map(&:to_sym)
- VALID_OPTIONS =
CONFIG_OPTIONS + FIELD_OPTIONS
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#orderable_class ⇒ Object
readonly
Returns the value of attribute orderable_class.
Class Method Summary collapse
Instance Method Summary collapse
- #default_configuration ⇒ Object
-
#initialize(parent, options = {}) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(parent, options = {}) ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 16 |
# File 'lib/mongoid/orderable/configuration.rb', line 11 def initialize(parent, = {}) @orderable_class = parent () set_orderable_scope end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/mongoid/orderable/configuration.rb', line 9 def @options end |
#orderable_class ⇒ Object (readonly)
Returns the value of attribute orderable_class.
9 10 11 |
# File 'lib/mongoid/orderable/configuration.rb', line 9 def orderable_class @orderable_class end |
Class Method Details
.build(parent, options = {}) ⇒ Object
26 27 28 |
# File 'lib/mongoid/orderable/configuration.rb', line 26 def self.build(parent, = {}) new(parent, ). end |
Instance Method Details
#default_configuration ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/mongoid/orderable/configuration.rb', line 18 def default_configuration { :column => :position, :index => true, :scope => nil, :base => 1, :field_opts => { :type => Integer }} end |