We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 914bb57 commit 8ac71b4Copy full SHA for 8ac71b4
activesupport/lib/active_support/json/encoding.rb
@@ -44,7 +44,7 @@ class << self
44
# ActiveSupport::JSON.encode({ key: "\u2028<>&" }, html_safe: false)
45
# # => "{\"key\":\"\u2028<>&\"}"
46
def encode(value, options = nil)
47
- if options.nil?
+ if options.nil? || options.empty?
48
Encoding.encode_without_options(value)
49
else
50
Encoding.json_encoder.new(options).encode(value)
0 commit comments