diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2012-05-22 12:08:51 -0700 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2012-05-22 12:08:51 -0700 |
commit | a5430024fd7e654d379b20373247033f68ec0a21 (patch) | |
tree | 8f9f727fc2ffd24c9cd46e858343f5bed6b9d16c /activeresource/activeresource.gemspec | |
parent | 56b86a377a9fa7d63a6fce1e5801c4910dfc703e (diff) | |
download | rails-a5430024fd7e654d379b20373247033f68ec0a21.tar.gz rails-a5430024fd7e654d379b20373247033f68ec0a21.tar.bz2 rails-a5430024fd7e654d379b20373247033f68ec0a21.zip |
Restore the frozen state on rollback. Fixes #6417.
This is a 3-2-stable backport for #6420 which was merged into master.
Currently, when saving a frozen record, an exception would be thrown
which causes a rollback. However, there is a bug in active record that
"defrost" the record as a side effect:
>> t = Topic.new
=> #<Topic id: nil, ...>
>> t.freeze
=> #<Topic id: nil, ...>
>> t.save
RuntimeError: can't modify a frozen Hash
>> t.frozen?
=> false
>> t.save
=> true
This patch fixes the bug by explictly restoring the frozen state on the
attributes Hash after every rollback.
Diffstat (limited to 'activeresource/activeresource.gemspec')
0 files changed, 0 insertions, 0 deletions