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 if unless 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.
26 27 28 29 30 31 |
# File 'lib/mongoid/orderable/configs/field_config.rb', line 26 def initialize(parent, = {}) @orderable_class = parent () set_orderable_scope end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
23 24 25 |
# File 'lib/mongoid/orderable/configs/field_config.rb', line 23 def @options end |
#orderable_class ⇒ Object (readonly)
Returns the value of attribute orderable_class.
23 24 25 |
# File 'lib/mongoid/orderable/configs/field_config.rb', line 23 def orderable_class @orderable_class end |
Instance Method Details
#global_config ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/mongoid/orderable/configs/field_config.rb', line 33 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 |