diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2012-06-10 16:23:34 +0100 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2012-06-10 16:23:34 +0100 |
commit | c2e61aa61540802e5a5d9b54ff04b803d770eff6 (patch) | |
tree | 1b9ba45c96e8d30f12c63928e2b8e0c476221819 /activesupport/lib/active_support/rescuable.rb | |
parent | 42259f69ae3fa2daacfb751dbc663adb14159e37 (diff) | |
download | rails-c2e61aa61540802e5a5d9b54ff04b803d770eff6.tar.gz rails-c2e61aa61540802e5a5d9b54ff04b803d770eff6.tar.bz2 rails-c2e61aa61540802e5a5d9b54ff04b803d770eff6.zip |
Ensure that mass assignment options are preserved
There are two possible scenarios where the @mass_assignment_options
instance variable can become corrupted:
1. If the assign_attributes doesn't complete correctly, then
subsequent calls to a nested attribute assignment method will use
whatever options were passed to the previous assign_attributes call.
2. With nested assign_attributes calls, the inner call will overwrite
the current options. This will only affect nested attributes as the
attribute hash is sanitized before any methods are called.
To fix this we save the current options in a local variable and then
restore these options in an ensure block.
Diffstat (limited to 'activesupport/lib/active_support/rescuable.rb')
0 files changed, 0 insertions, 0 deletions