From d5580b91b64daeb114875f24f6d54bbf88428018 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Tue, 9 Sep 2014 09:44:48 +0200 Subject: Allow included modules to override association methods. Closes #16684. This is achieved by always generating `GeneratedAssociationMethods` when `ActiveRecord::Base` is subclassed. When some of the included modules of `ActiveRecord::Base` were reordered this behavior was broken as `Core#initialize_generated_modules` was no longer called. Meaning that the module was generated on first access. --- activerecord/lib/active_record/attribute_methods.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/lib/active_record/attribute_methods.rb') diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index 43a3993898..36d0d63c71 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -69,6 +69,8 @@ module ActiveRecord @generated_attribute_methods = GeneratedAttributeMethods.new { extend Mutex_m } @attribute_methods_generated = false include @generated_attribute_methods + + super end # Generates all the attribute related methods for columns in the database -- cgit v1.2.3