aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorPaul Kuruvilla <rohitpaulk@gmail.com>2017-10-23 15:17:31 +0530
committerPaul Kuruvilla <rohitpaulk@gmail.com>2017-10-23 15:49:00 +0530
commit813f8e333dabb2050d6b668b7bdd68b4979e8af4 (patch)
tree1bdf5e8b3e657f2cd8dd73b247724b51bb33d5fc /activesupport/lib
parentf4d1aa5310284ebceb51970140fa08f6c8ea19b6 (diff)
downloadrails-813f8e333dabb2050d6b668b7bdd68b4979e8af4.tar.gz
rails-813f8e333dabb2050d6b668b7bdd68b4979e8af4.tar.bz2
rails-813f8e333dabb2050d6b668b7bdd68b4979e8af4.zip
Fix #to_json for unreadable IO objects, fixes #26132
Diffstat (limited to 'activesupport/lib')
-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