diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2012-05-21 14:57:04 -0700 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2012-05-21 14:57:04 -0700 |
commit | cb847b9f2e56eeff737323d9a42a2a0a6c23804d (patch) | |
tree | c22d2cf52201134bea2e32bc15706b0d998d8133 /tools/profile | |
parent | 03886d817307e091024ff3bd26844447abd8c408 (diff) | |
download | rails-cb847b9f2e56eeff737323d9a42a2a0a6c23804d.tar.gz rails-cb847b9f2e56eeff737323d9a42a2a0a6c23804d.tar.bz2 rails-cb847b9f2e56eeff737323d9a42a2a0a6c23804d.zip |
Restore the frozen state on rollback. Fixes #6417.
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 'tools/profile')
0 files changed, 0 insertions, 0 deletions