From 8eb7561ac6e8f020ec09608532de310c6b0b8dcd Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 2 Jul 2013 17:11:35 -0700 Subject: initialize generated modules on inclusion and on inheritence --- activerecord/lib/active_record/attribute_methods.rb | 2 +- activerecord/test/cases/attribute_methods/read_test.rb | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index abaa820ac5..701fd4e3fa 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -8,7 +8,7 @@ module ActiveRecord include ActiveModel::AttributeMethods included do - @attribute_methods_generated = false + initialize_generated_modules include Read include Write include BeforeTypeCast diff --git a/activerecord/test/cases/attribute_methods/read_test.rb b/activerecord/test/cases/attribute_methods/read_test.rb index 6dbebf4b6f..c0659fddef 100644 --- a/activerecord/test/cases/attribute_methods/read_test.rb +++ b/activerecord/test/cases/attribute_methods/read_test.rb @@ -15,13 +15,6 @@ module ActiveRecord include ActiveRecord::AttributeMethods - def self.define_attribute_methods - # Created in the inherited/included hook for "proper" ARs - @attribute_methods_mutex ||= Mutex.new - - super - end - def self.column_names %w{ one two three } end -- cgit v1.2.3