From dc05914be766583a22c959b2df64cfd2dfe88732 Mon Sep 17 00:00:00 2001 From: Sergey Nartimov Date: Sun, 1 Jan 2012 20:16:10 +0300 Subject: use #to_s to convert Range to json --- activesupport/lib/active_support/json/encoding.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport/lib/active_support') 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 -- cgit v1.2.3