From 17af1ab3beb36de6d3e260017c6f9926c7050429 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 2 Jul 2013 14:40:37 -0700 Subject: initialize ivars so we don't have to constantly check them --- activerecord/lib/active_record/attribute_methods.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (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 7c422ecbe0..0a869f9685 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -8,6 +8,7 @@ module ActiveRecord include ActiveModel::AttributeMethods included do + @attribute_methods_generated = false include Read include Write include BeforeTypeCast @@ -26,6 +27,7 @@ module ActiveRecord def initialize_generated_modules # :nodoc: @generated_attribute_methods = Module.new { extend Mutex_m } + @attribute_methods_generated = false include @generated_attribute_methods end @@ -43,7 +45,7 @@ module ActiveRecord end def attribute_methods_generated? # :nodoc: - @attribute_methods_generated ||= false + @attribute_methods_generated end def undefine_attribute_methods # :nodoc: -- cgit v1.2.3