aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorAlex Le <alexnhatle@yahoo.com>2010-07-30 15:47:26 -0500
committerJosé Valim <jose.valim@gmail.com>2010-08-02 16:26:32 +0200
commitaeaab06c79a9e3cfa9988270847fa8c6f863570a (patch)
tree29a00f89e0f94708a8a09a22f6d69c5fa9f932d4 /activemodel/lib/active_model
parent59cf514a5b769257a1538736d91f48ee0900e236 (diff)
downloadrails-aeaab06c79a9e3cfa9988270847fa8c6f863570a.tar.gz
rails-aeaab06c79a9e3cfa9988270847fa8c6f863570a.tar.bz2
rails-aeaab06c79a9e3cfa9988270847fa8c6f863570a.zip
ActiveModel::Errors json serialization to work as Rails 3b4 [#5254 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/errors.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index bf93126d27..f39678db83 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -169,9 +169,9 @@ module ActiveModel
to_a.to_xml options.reverse_merge(:root => "errors", :skip_types => true)
end
- # Returns an array as JSON representation for this object.
+ # Returns an ActiveSupport::OrderedHash that can be used as the JSON representation for this object.
def as_json(options=nil)
- to_a
+ self
end
# Adds +message+ to the error messages on +attribute+, which will be returned on a call to