diff options
author | Sean Griffin <sean@thoughtbot.com> | 2015-06-12 11:00:27 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-06-12 11:03:12 -0600 |
commit | 07b4078eb664dd45b1526a85358574ea8e669ce3 (patch) | |
tree | 27160010746fb8134ebb1262be0dd97605c05b8b /version.rb | |
parent | 8beb328befa53d74fe9c7942ddb188563bd4de33 (diff) | |
download | rails-07b4078eb664dd45b1526a85358574ea8e669ce3.tar.gz rails-07b4078eb664dd45b1526a85358574ea8e669ce3.tar.bz2 rails-07b4078eb664dd45b1526a85358574ea8e669ce3.zip |
Don't crash when mutating attributes in a getter
If a getter has side effects on the DB, `changes_applied` will be called
twice. The second time will try and remove the changed attributes cache,
and will crash because it's already been unset. This also demonstrates
that we shouldn't assume that calling getters won't change the value of
`changed_attributes`, and we need to clear the cache if an attribute is
modified.
Fixes #20531.
Diffstat (limited to 'version.rb')
0 files changed, 0 insertions, 0 deletions