diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2019-04-29 12:31:41 +0200 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2019-05-02 13:25:18 +0200 |
commit | cce26c36cae49f0143ce2305dbf5b00cca0e53c1 (patch) | |
tree | b060c274d60717b37847c1e62800eb32fed3b789 /activerecord/lib/active_record | |
parent | 730a7a1b7909095dd48b9f32bbae5fd5a023fa60 (diff) | |
download | rails-cce26c36cae49f0143ce2305dbf5b00cca0e53c1.tar.gz rails-cce26c36cae49f0143ce2305dbf5b00cca0e53c1.tar.bz2 rails-cce26c36cae49f0143ce2305dbf5b00cca0e53c1.zip |
Namespace association extension modules under the owner model
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/collection_association.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/builder/collection_association.rb b/activerecord/lib/active_record/associations/builder/collection_association.rb index e53665ce82..e78d25441b 100644 --- a/activerecord/lib/active_record/associations/builder/collection_association.rb +++ b/activerecord/lib/active_record/associations/builder/collection_association.rb @@ -22,9 +22,9 @@ module ActiveRecord::Associations::Builder # :nodoc: def self.define_extensions(model, name, &block) if block_given? - extension_module_name = "#{model.name.demodulize}#{name.to_s.camelize}AssociationExtension" + extension_module_name = "#{name.to_s.camelize}AssociationExtension" extension = Module.new(&block) - model.module_parent.const_set(extension_module_name, extension) + model.const_set(extension_module_name, extension) end end |