diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2013-01-23 14:54:56 +0000 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2013-01-23 14:54:56 +0000 |
commit | 1b75b94de6d474d56a6c47e74bdbd985ec14087b (patch) | |
tree | 3c81b8d69628833041e596f101cf6770e482f5be /actionpack/test/fixtures/plain_text_with_characters.raw | |
parent | e20c0e3a8f17d716720d248d3db5f022f7cb021a (diff) | |
download | rails-1b75b94de6d474d56a6c47e74bdbd985ec14087b.tar.gz rails-1b75b94de6d474d56a6c47e74bdbd985ec14087b.tar.bz2 rails-1b75b94de6d474d56a6c47e74bdbd985ec14087b.zip |
Remove warning by using a custom coder
The native JSON library bypasses the `to_json` overrides in
active_support/core_ext/object/to_json.rb by calling its native
implementation directly. However `ActiveRecord::Store` uses a
HWIA so `JSON.dump` will call our `to_json` instead with a
`State` object for options rather than a `Hash`. This generates
a warning when the `:encoding`, `:only` & `:except` keys are
accessed in `Hash#as_json` because the `State` object delegates
unknown keys to `instance_variable_get` in its `:[]` method.
Workaround this warning in the test by using a custom coder that
calls `ActiveSupport::JSON.encode` directly.
Diffstat (limited to 'actionpack/test/fixtures/plain_text_with_characters.raw')
0 files changed, 0 insertions, 0 deletions