diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-02 15:44:58 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-02 15:44:58 -0700 |
commit | 1a5394f4afdf2eeadd91b5b0ff5ad199c9dc93b0 (patch) | |
tree | f83674e1e3d6000eebcee6b393b18cec528da3de /activerecord | |
parent | 6e43fcb33365c66359e6363abdc2d108aef9fd67 (diff) | |
download | rails-1a5394f4afdf2eeadd91b5b0ff5ad199c9dc93b0.tar.gz rails-1a5394f4afdf2eeadd91b5b0ff5ad199c9dc93b0.tar.bz2 rails-1a5394f4afdf2eeadd91b5b0ff5ad199c9dc93b0.zip |
lock around mutating the generated methods module
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index ff93640814..5e990955ab 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -46,8 +46,10 @@ module ActiveRecord 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 |