Module: ActiveModel::Associations::Hooks
- Defined in:
- lib/active_model/associations/hooks.rb,
lib/eac_rails_utils/patches/active_model_associations.rb
Class Method Summary collapse
- .init ⇒ Object
- .init_rails_4 ⇒ Object
- .init_rails_5_2 ⇒ Object
- .rails_5_2_fix_activemodel_associations_methods ⇒ Object
Class Method Details
.init ⇒ Object
3 4 5 6 7 8 |
# File 'lib/active_model/associations/hooks.rb', line 3 def self.init ActiveSupport.on_load(:active_record) do require 'active_model/associations/association_scope_extension' ActiveRecord::Associations::AssociationScope.send(:prepend, ActiveModel::Associations::AssociationScopeExtension) end end |
.init_rails_4 ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/eac_rails_utils/patches/active_model_associations.rb', line 16 def init_rails_4 ActiveSupport.on_load(:active_record) do ActiveRecord::Associations::AssociationScope.prepend( ::EacRailsUtils::Patches::Rails4::ActiveRecordAssociationsAssociationScope ) end end |
.init_rails_5_2 ⇒ Object
24 25 26 |
# File 'lib/eac_rails_utils/patches/active_model_associations.rb', line 24 def init_rails_5_2 rails_5_2_fix_activemodel_associations_methods end |
.rails_5_2_fix_activemodel_associations_methods ⇒ Object
28 29 30 31 32 |
# File 'lib/eac_rails_utils/patches/active_model_associations.rb', line 28 def rails_5_2_fix_activemodel_associations_methods %i[belongs_to has_many].each do |method| ::EacRailsUtils::Patches::Rails52::ActiveModelAssociationMethodFix.new(method) end end |