aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-07-02 14:40:37 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-07-02 14:40:37 -0700
commit17af1ab3beb36de6d3e260017c6f9926c7050429 (patch)
tree6c6b99bbec2c73bfba4b424596ac24d73dfda00a /activerecord/lib/active_record/attribute_methods.rb
parent09b31f08d4a4930dc66d401c94b2e5e49c250fc1 (diff)
downloadrails-17af1ab3beb36de6d3e260017c6f9926c7050429.tar.gz
rails-17af1ab3beb36de6d3e260017c6f9926c7050429.tar.bz2
rails-17af1ab3beb36de6d3e260017c6f9926c7050429.zip
initialize ivars so we don't have to constantly check them
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb4
1 files changed, 3 insertions, 1 deletions
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: