Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

lock around mutating the generated methods module

  • Loading branch information...
commit fc862200d6379e79aa1724c9a42d08b184998d4d 1 parent 714634a
@tenderlove tenderlove authored rafaelfranca committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 activerecord/lib/active_record/attribute_methods.rb
View
6 activerecord/lib/active_record/attribute_methods.rb
@@ -57,8 +57,10 @@ def define_attribute_methods # :nodoc:
end
def undefine_attribute_methods # :nodoc:
- super if @attribute_methods_generated
- @attribute_methods_generated = false
+ generated_attribute_methods.synchronize do
+ super if @attribute_methods_generated
+ @attribute_methods_generated = false
+ end
end
# Raises a <tt>ActiveRecord::DangerousAttributeError</tt> exception when an
Please sign in to comment.
Something went wrong with that request. Please try again.