aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json/encoding.rb
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-05-30 13:06:50 -0700
committerPiotr Sarnacki <drogus@gmail.com>2012-05-30 13:06:50 -0700
commit9f1b689cd93f448e2194fda552037b77cd8ea794 (patch)
tree47666ed398c70d9471164024d2f3e04dedc194bf /activesupport/lib/active_support/json/encoding.rb
parentc470001891990b067f9e76b5a5c0ae49be1a507f (diff)
parentbcfa013399fd2c5b5d25c38912cba3560de1cc57 (diff)
downloadrails-9f1b689cd93f448e2194fda552037b77cd8ea794.tar.gz
rails-9f1b689cd93f448e2194fda552037b77cd8ea794.tar.bz2
rails-9f1b689cd93f448e2194fda552037b77cd8ea794.zip
Merge pull request #6553 from erichmenge/3-2-stable-json-patch
3 2 stable json patch
Diffstat (limited to 'activesupport/lib/active_support/json/encoding.rb')
-rw-r--r--activesupport/lib/active_support/json/encoding.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb
index 4a19387511..91e4f07c6c 100644
--- a/activesupport/lib/active_support/json/encoding.rb
+++ b/activesupport/lib/active_support/json/encoding.rb
@@ -158,18 +158,18 @@ class Struct #:nodoc:
end
class TrueClass
- AS_JSON = ActiveSupport::JSON::Variable.new('true').freeze
- def as_json(options = nil) AS_JSON end #:nodoc:
+ def as_json(options = nil) self end #:nodoc:
+ def encode_json(encoder) to_s end #:nodoc:
end
class FalseClass
- AS_JSON = ActiveSupport::JSON::Variable.new('false').freeze
- def as_json(options = nil) AS_JSON end #:nodoc:
+ def as_json(options = nil) self end #:nodoc:
+ def encode_json(encoder) to_s end #:nodoc:
end
class NilClass
- AS_JSON = ActiveSupport::JSON::Variable.new('null').freeze
- def as_json(options = nil) AS_JSON end #:nodoc:
+ def as_json(options = nil) self end #:nodoc:
+ def encode_json(encoder) 'null' end #:nodoc:
end
class String