Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

initialize ivars so we don't have to constantly check them

  • Loading branch information...
commit 17af1ab3beb36de6d3e260017c6f9926c7050429 1 parent 09b31f0
@tenderlove tenderlove authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/attribute_methods.rb
View
4 activerecord/lib/active_record/attribute_methods.rb
@@ -8,6 +8,7 @@ module AttributeMethods
include ActiveModel::AttributeMethods
included do
+ @attribute_methods_generated = false
include Read
include Write
include BeforeTypeCast
@@ -26,6 +27,7 @@ def inherited(child_class) #:nodoc:
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 @@ def define_attribute_methods # :nodoc:
end
def attribute_methods_generated? # :nodoc:
- @attribute_methods_generated ||= false
+ @attribute_methods_generated
end
def undefine_attribute_methods # :nodoc:
Please sign in to comment.
Something went wrong with that request. Please try again.