Module: Goldiloader::AssociationOptions
- Extended by:
- AssociationOptions
- Included in:
- AssociationOptions
- Defined in:
- lib/goldiloader/association_options.rb
Defined Under Namespace
Modules: AssociationBuilderExtension
Constant Summary collapse
- OPTIONS =
[:auto_include, :fully_load].freeze
Instance Method Summary collapse
Instance Method Details
#register ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/goldiloader/association_options.rb', line 20 def register if ::ActiveRecord::VERSION::MAJOR >= 5 ActiveRecord::Associations::Builder::Association.extensions << AssociationBuilderExtension elsif ::ActiveRecord::VERSION::MAJOR >= 4 ActiveRecord::Associations::Builder::Association..concat(OPTIONS) else # Each subclass of CollectionAssociation will have its own copy of valid_options so we need # to register the valid option for each one. collection_association_classes.each do |assoc_class| assoc_class..concat(OPTIONS) end end end |