aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib/active_resource/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activeresource/lib/active_resource/base.rb')
-rw-r--r--activeresource/lib/active_resource/base.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb
index c0d51797ee..5ef50b6e03 100644
--- a/activeresource/lib/active_resource/base.rb
+++ b/activeresource/lib/active_resource/base.rb
@@ -234,7 +234,7 @@ module ActiveResource
# ryan.save # => false
#
# # When
- # # PUT https://api.people.com/people/1.json
+ # # PUT https://api.people.com/people/1.xml
# # or
# # PUT https://api.people.com/people/1.json
# # is requested with invalid values, the response is:
@@ -242,12 +242,21 @@ module ActiveResource
# # Response (422):
# # <errors><error>First cannot be empty</error></errors>
# # or
- # # {"errors":["First cannot be empty"]}
+ # # {"errors":{"first":["cannot be empty"]}}
# #
#
# ryan.errors.invalid?(:first) # => true
# ryan.errors.full_messages # => ['First cannot be empty']
#
+ # For backwards-compatibility with older endpoints, the following formats are also supported in JSON responses:
+ #
+ # # {"errors":['First cannot be empty']}
+ # # This was the required format for previous versions of ActiveResource
+ # # {"first":["cannot be empty"]}
+ # # This was the default format produced by respond_with in ActionController <3.2.1
+ #
+ # Parsing either of these formats will result in a deprecation warning.
+ #
# Learn more about Active Resource's validation features in the ActiveResource::Validations documentation.
#
# === Timeouts