Permalink
Browse files

lock around mutating the generated methods module

  • Loading branch information...
1 parent 6e43fcb commit 1a5394f4afdf2eeadd91b5b0ff5ad199c9dc93b0 @tenderlove tenderlove committed Jul 2, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 activerecord/lib/active_record/attribute_methods.rb
@@ -46,8 +46,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 1a5394f

Please sign in to comment.