From 07ad2a945b6e9ec9421746294bd0b6787fd0ecdd Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Wed, 13 May 2015 10:54:24 -0300 Subject: Remove not used `options` argument from `ActiveSupport::JSON.decode` In Rails 4.0, json decoding relied on MultiJson. This changed from 4.1 forward since it reached its end of life, and this extra argument was kept for compatibility. We are safe to remove it now. --- activesupport/lib/active_support/json/decoding.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/json/decoding.rb b/activesupport/lib/active_support/json/decoding.rb index 35548f3f56..2932954f03 100644 --- a/activesupport/lib/active_support/json/decoding.rb +++ b/activesupport/lib/active_support/json/decoding.rb @@ -9,20 +9,14 @@ module ActiveSupport module JSON # matches YAML-formatted dates DATE_REGEX = /^(?:\d{4}-\d{2}-\d{2}|\d{4}-\d{1,2}-\d{1,2}[T \t]+\d{1,2}:\d{2}:\d{2}(\.[0-9]*)?(([ \t]*)Z|[-+]\d{2}?(:\d{2})?))$/ - + class << self # Parses a JSON string (JavaScript Object Notation) into a hash. # See http://www.json.org for more info. # # ActiveSupport::JSON.decode("{\"team\":\"rails\",\"players\":\"36\"}") # => {"team" => "rails", "players" => "36"} - def decode(json, options = {}) - if options.present? - raise ArgumentError, "In Rails 4.1, ActiveSupport::JSON.decode no longer " \ - "accepts an options hash for MultiJSON. MultiJSON reached its end of life " \ - "and has been removed." - end - + def decode(json) data = ::JSON.parse(json, quirks_mode: true) if ActiveSupport.parse_json_times -- cgit v1.2.3