aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2013-11-19 19:47:34 -0800
committerGodfrey Chan <godfreykfc@gmail.com>2013-11-26 09:51:51 -0800
commit80e7552073712e102c584cfc54cb3eff2c1f0f52 (patch)
treeb86ba7c8a5b4bc2b49065a2aa62bb2b2349b8b70 /activesupport/lib/active_support/core_ext/object
parent4d02296cfbd69b4d2757dfd20f23d778bb23b81b (diff)
downloadrails-80e7552073712e102c584cfc54cb3eff2c1f0f52.tar.gz
rails-80e7552073712e102c584cfc54cb3eff2c1f0f52.tar.bz2
rails-80e7552073712e102c584cfc54cb3eff2c1f0f52.zip
Removed the Ruby encoder and switched to using the JSON gem
Got all the tests passing again. Support for `encode_json` has been removed (and consequently the ability to encode `BigDecimal`s as numbers, as mentioned in the previous commit). Install the `activesupport-json_encoder` gem to get it back.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object')
-rw-r--r--activesupport/lib/active_support/core_ext/object/json.rb28
1 files changed, 0 insertions, 28 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/json.rb b/activesupport/lib/active_support/core_ext/object/json.rb
index bae9190687..75ab3db268 100644
--- a/activesupport/lib/active_support/core_ext/object/json.rb
+++ b/activesupport/lib/active_support/core_ext/object/json.rb
@@ -62,40 +62,24 @@ class TrueClass
def as_json(options = nil) #:nodoc:
self
end
-
- def encode_json(encoder) #:nodoc:
- to_s
- end
end
class FalseClass
def as_json(options = nil) #:nodoc:
self
end
-
- def encode_json(encoder) #:nodoc:
- to_s
- end
end
class NilClass
def as_json(options = nil) #:nodoc:
self
end
-
- def encode_json(encoder) #:nodoc:
- 'null'
- end
end
class String
def as_json(options = nil) #:nodoc:
self
end
-
- def encode_json(encoder) #:nodoc:
- encoder.escape(self)
- end
end
class Symbol
@@ -108,10 +92,6 @@ class Numeric
def as_json(options = nil) #:nodoc:
self
end
-
- def encode_json(encoder) #:nodoc:
- to_s
- end
end
class Float
@@ -159,10 +139,6 @@ class Array
def as_json(options = nil) #:nodoc:
map { |v| options ? v.as_json(options.dup) : v.as_json }
end
-
- def encode_json(encoder) #:nodoc:
- "[#{map { |v| v.as_json.encode_json(encoder) } * ','}]"
- end
end
class Hash
@@ -182,10 +158,6 @@ class Hash
Hash[subset.map { |k, v| [k.to_s, options ? v.as_json(options.dup) : v.as_json] }]
end
-
- def encode_json(encoder) #:nodoc:
- "{#{map { |k,v| "#{k.as_json.encode_json(encoder)}:#{v.as_json.encode_json(encoder)}" } * ','}}"
- end
end
class Time