diff options
author | Xavier Noria <fxn@hashref.com> | 2012-01-02 13:53:52 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-01-02 13:53:52 -0800 |
commit | e04232e9040646d117df14cde626375d9d4be48a (patch) | |
tree | c1a89e65f9bdd577eb9e30ff235baf93e0b84f80 /activesupport/lib | |
parent | 6de1b2ad89bdc0d7348e2805a7ac66c9d6e89653 (diff) | |
parent | dc05914be766583a22c959b2df64cfd2dfe88732 (diff) | |
download | rails-e04232e9040646d117df14cde626375d9d4be48a.tar.gz rails-e04232e9040646d117df14cde626375d9d4be48a.tar.bz2 rails-e04232e9040646d117df14cde626375d9d4be48a.zip |
Merge pull request #4250 from lest/range-json
use #to_s to convert Range to json
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/json/encoding.rb | 4 |
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 |