aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json/encoders/object.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/json/encoders/object.rb')
-rw-r--r--activesupport/lib/active_support/json/encoders/object.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/json/encoders/object.rb b/activesupport/lib/active_support/json/encoders/object.rb
index 57603bd1e6..4722feb7db 100644
--- a/activesupport/lib/active_support/json/encoders/object.rb
+++ b/activesupport/lib/active_support/json/encoders/object.rb
@@ -2,9 +2,12 @@ require 'active_support/core_ext/object/instance_variables'
class Object
# Dumps object in JSON (JavaScript Object Notation). See www.json.org for more info.
- def rails_to_json(options = nil)
- ActiveSupport::JSON.encode(instance_values, options)
+ def to_json(options = nil)
+ rails_to_json(options)
end
- alias to_json rails_to_json
+ private
+ def rails_to_json(options = nil)
+ ActiveSupport::JSON.encode(instance_values, options)
+ end
end