aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/object/json.rb
diff options
context:
space:
mode:
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, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/json.rb b/activesupport/lib/active_support/core_ext/object/json.rb
index 554da1a2aa..c50cd57c2c 100644
--- a/activesupport/lib/active_support/core_ext/object/json.rb
+++ b/activesupport/lib/active_support/core_ext/object/json.rb
@@ -20,16 +20,16 @@ end
class Object
def as_json(options = nil) #:nodoc:
if respond_to?(:to_hash)
- to_hash
+ to_hash.as_json(options)
else
- instance_values
+ instance_values.as_json(options)
end
end
end
class Struct #:nodoc:
def as_json(options = nil)
- Hash[members.zip(values)]
+ Hash[members.zip(values)].as_json(options)
end
end