aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activeresource/lib')
-rw-r--r--activeresource/lib/active_resource/base.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb
index 6cb5beb789..2e742267ba 100644
--- a/activeresource/lib/active_resource/base.rb
+++ b/activeresource/lib/active_resource/base.rb
@@ -887,9 +887,12 @@ module ActiveResource
# person.to_json(:except => ["first_name"])
# # => {"last_name": "Smith"}
def to_json(options={})
- attributes.to_json(options)
+ ActiveSupport::JSON.encode(attributes, options)
end
+ # For compatibility with ActiveSupport::JSON.encode
+ alias rails_to_json to_json
+
# Returns the serialized string representation of the resource in the configured
# serialization format specified in ActiveResource::Base.format. The options
# applicable depend on the configured encoding format.