From 080e2a7abf8314338a41f72821703b23c86b3c45 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 1 Apr 2011 12:14:53 -0700 Subject: Enumerable should pass encoding options to children in #as_json/#to_json. --- activesupport/lib/active_support/json/encoding.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (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 82b8a7e148..1fafc36ee8 100644 --- a/activesupport/lib/active_support/json/encoding.rb +++ b/activesupport/lib/active_support/json/encoding.rb @@ -205,7 +205,9 @@ class Regexp end module Enumerable - def as_json(options = nil) to_a end #:nodoc: + def as_json(options = nil) #:nodoc: + to_a.as_json(options) + end end class Array -- cgit v1.2.3