diff options
author | Yves Senn <yves.senn@garaio.com> | 2012-11-12 14:33:20 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@garaio.com> | 2012-11-12 16:06:08 +0100 |
commit | 78dca351037c5f34971bdf0dd7d0b8fc9b9bdeb4 (patch) | |
tree | fc3a9536930132ae531f8e442359ff57f40dc236 /activesupport/lib | |
parent | 2f3d81c764a8b527299be8c33c64814431f83482 (diff) | |
download | rails-78dca351037c5f34971bdf0dd7d0b8fc9b9bdeb4.tar.gz rails-78dca351037c5f34971bdf0dd7d0b8fc9b9bdeb4.tar.bz2 rails-78dca351037c5f34971bdf0dd7d0b8fc9b9bdeb4.zip |
`#as_json` isolates options when encoding a hash. Closes #8182
Setting options in a custom `#as_json` method had side effects.
Modifications of the `options` hash leaked outside and influenced
the conversion of other objects contained in the hash.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/json/encoding.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb index f65c831e04..7a5c351ca8 100644 --- a/activesupport/lib/active_support/json/encoding.rb +++ b/activesupport/lib/active_support/json/encoding.rb @@ -65,7 +65,7 @@ module ActiveSupport # they can detect circular references. options.merge(:encoder => self) else - options + options.dup end end |