Class: Mongoid::Orderable::Configs::FieldConfig
- Inherits:
-
Object
- Object
- Mongoid::Orderable::Configs::FieldConfig
- Defined in:
- lib/mongoid/orderable/configs/field_config.rb
Constant Summary collapse
- CONFIG_OPTIONS =
i[field scope foreign_key inherited base index default use_transactions transaction_max_retries lock_collection].freeze
- ALIASES =
{ column: :field }.freeze
- FIELD_OPTIONS =
i[as].freeze
- VALID_OPTIONS =
(CONFIG_OPTIONS | FIELD_OPTIONS).freeze
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#orderable_class ⇒ Object
readonly
Returns the value of attribute orderable_class.
Instance Method Summary collapse
- #global_config ⇒ Object
-
#initialize(parent, options = {}) ⇒ FieldConfig
constructor
A new instance of FieldConfig.
Constructor Details
#initialize(parent, options = {}) ⇒ FieldConfig
Returns a new instance of FieldConfig.
24 25 26 27 28 29 |
# File 'lib/mongoid/orderable/configs/field_config.rb', line 24 def initialize(parent, = {}) @orderable_class = parent () set_orderable_scope end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
21 22 23 |
# File 'lib/mongoid/orderable/configs/field_config.rb', line 21 def end |
#orderable_class ⇒ Object (readonly)
Returns the value of attribute orderable_class.
21 22 23 |
# File 'lib/mongoid/orderable/configs/field_config.rb', line 21 def orderable_class @orderable_class end |
Instance Method Details
#global_config ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/mongoid/orderable/configs/field_config.rb', line 31 def global_config cfg = Mongoid::Orderable.config { field: cfg.field, as: cfg.as, index: cfg.index, base: cfg.base, use_transactions: cfg.use_transactions, transaction_max_retries: cfg.transaction_max_retries, lock_collection: cfg.lock_collection } end |