aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object/json.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2017-10-23 15:33:16 -0400
committerRafael Mendonça França <rafaelmfranca@gmail.com>2017-10-23 15:33:16 -0400
commit9c5c0596f137c396b6356416a3f92a3a082c53f6 (patch)
tree2aeea8ba25b27f03969a4d5e253e662b48dbcacd /activesupport/lib/active_support/core_ext/object/json.rb
parentc085a2a1a2a9ecfe8f9acfc177798046087c269e (diff)
parent813f8e333dabb2050d6b668b7bdd68b4979e8af4 (diff)
downloadrails-9c5c0596f137c396b6356416a3f92a3a082c53f6.tar.gz
rails-9c5c0596f137c396b6356416a3f92a3a082c53f6.tar.bz2
rails-9c5c0596f137c396b6356416a3f92a3a082c53f6.zip
Merge pull request #30953 from rohitpaulk/fix-io-to-json
Fix #to_json for IO objects, fixes #26132
Diffstat (limited to 'activesupport/lib/active_support/core_ext/object/json.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/object/json.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/json.rb b/activesupport/lib/active_support/core_ext/object/json.rb
index 0a3b875f24..f7c623fe13 100644
--- a/activesupport/lib/active_support/core_ext/object/json.rb
+++ b/activesupport/lib/active_support/core_ext/object/json.rb
@@ -135,6 +135,12 @@ module Enumerable
end
end
+class IO
+ def as_json(options = nil) #:nodoc:
+ to_s
+ end
+end
+
class Range
def as_json(options = nil) #:nodoc:
to_s