aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorSergey Nartimov <just.lest@gmail.com>2012-01-01 20:16:10 +0300
committerSergey Nartimov <just.lest@gmail.com>2012-01-01 20:16:10 +0300
commitdc05914be766583a22c959b2df64cfd2dfe88732 (patch)
treeed42f6e7242db34ef44c380ec50f15b317ee7247 /activesupport/lib/active_support
parentf3e079e8b54da1c4d0511495ced3f68c1b7a46f1 (diff)
downloadrails-dc05914be766583a22c959b2df64cfd2dfe88732.tar.gz
rails-dc05914be766583a22c959b2df64cfd2dfe88732.tar.bz2
rails-dc05914be766583a22c959b2df64cfd2dfe88732.zip
use #to_s to convert Range to json
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/json/encoding.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb
index d7181035d3..07b6a940c6 100644
--- a/activesupport/lib/active_support/json/encoding.rb
+++ b/activesupport/lib/active_support/json/encoding.rb
@@ -206,6 +206,10 @@ module Enumerable
end
end
+class Range
+ def as_json(options = nil) to_s end #:nodoc:
+end
+
class Array
def as_json(options = nil) #:nodoc:
# use encoder as a proxy to call as_json on all elements, to protect from circular references