aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-07 03:19:56 -0700
committerJosé Valim <jose.valim@gmail.com>2011-05-07 03:19:56 -0700
commita761d77902cccdace9482d690a70a358a651337e (patch)
tree75ff11e75d935826b8a53d6358b1058f07e66a46 /activesupport/lib/active_support/json
parenta6ef255ff57519c174c87f45cb4c1d040050a364 (diff)
parent080e2a7abf8314338a41f72821703b23c86b3c45 (diff)
downloadrails-a761d77902cccdace9482d690a70a358a651337e.tar.gz
rails-a761d77902cccdace9482d690a70a358a651337e.tar.bz2
rails-a761d77902cccdace9482d690a70a358a651337e.zip
Merge pull request #248 from bigfix/enumerable_as_json
Enumerable should pass encoding options to children in #as_json/#to_json
Diffstat (limited to 'activesupport/lib/active_support/json')
-rw-r--r--activesupport/lib/active_support/json/encoding.rb4
1 files changed, 3 insertions, 1 deletions
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