We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f575fca commit 6204a55Copy full SHA for 6204a55
activesupport/lib/active_support/json/encoding.rb
@@ -38,7 +38,7 @@ class << self
38
# ActiveSupport::JSON.encode({ key: "<>&" }, escape_html_entities: false)
39
# # => "{\"key\":\"<>&\"}"
40
def encode(value, options = nil)
41
- if options.nil?
+ if options.nil? || options.empty?
42
Encoding.encode_without_options(value)
43
else
44
Encoding.json_encoder.new(options).encode(value)
0 commit comments