1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib
Godfrey Chan cb847b9f2e 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.
2012-05-21 14:57:04 -07:00
..
active_record Restore the frozen state on rollback. Fixes #6417. 2012-05-21 14:57:04 -07:00
rails/generators Refactor migration generator 2012-05-18 09:24:45 -07:00
active_record.rb Lazy load I18n 2012-05-11 19:00:25 -03:00