Restores frozen state after rollback, fixes #6417 (for 3-2-stable) #6419

Closed
wants to merge 1 commit into
from

Projects

None yet

1 participant

@chancancode
Ruby on Rails member

When saving a frozen? record, active record would raise an exception to complain about the frozen attributes, rollback the transaction. However, it also has the side effect of unfreezing the record after the rollback. This behaviour is undesirable and incorrect (saving a frozen? record twice in a roll would fail for the first time and succeed in the second time). This patch fixes the bug by explicitly restoring the frozen? state after a rollback.

This is my first patch for rails, so I apologize in advance if this should go in master instead of 3-2-stable. I can reapply this to master if that's more appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment