Skip to content
Browse files

lock around mutating the generated methods module

  • Loading branch information...
1 parent 714634a commit fc862200d6379e79aa1724c9a42d08b184998d4d @tenderlove tenderlove committed with rafaelfranca Jul 2, 2013
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

0 comments on commit fc86220

Please sign in to comment.
Something went wrong with that request. Please try again.