aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json/encoders/enumerable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/json/encoders/enumerable.rb')
-rw-r--r--activesupport/lib/active_support/json/encoders/enumerable.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/json/encoders/enumerable.rb b/activesupport/lib/active_support/json/encoders/enumerable.rb
new file mode 100644
index 0000000000..150d233939
--- /dev/null
+++ b/activesupport/lib/active_support/json/encoders/enumerable.rb
@@ -0,0 +1,5 @@
+module Enumerable
+ def to_json #:nodoc:
+ "[#{map { |value| ActiveSupport::JSON.encode(value) } * ', '}]"
+ end
+end