diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2015-05-13 10:54:24 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2015-05-13 10:59:01 -0300 |
commit | 07ad2a945b6e9ec9421746294bd0b6787fd0ecdd (patch) | |
tree | fecacfc216997cc2bb2992e0a9dd033cf5874de2 /activesupport | |
parent | ec779ad50176748eef716bdd7b2ca99e807038ae (diff) | |
download | rails-07ad2a945b6e9ec9421746294bd0b6787fd0ecdd.tar.gz rails-07ad2a945b6e9ec9421746294bd0b6787fd0ecdd.tar.bz2 rails-07ad2a945b6e9ec9421746294bd0b6787fd0ecdd.zip |
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.
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/json/decoding.rb | 10 |
1 files changed, 2 insertions, 8 deletions
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 |