aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-02-08 08:59:00 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-02-08 08:59:00 -0800
commit06b9c905a9e18bb6da7cc95e53870b7493137305 (patch)
tree3dccaccfeadaad8b265475abbbe25cc203da4c2f /activemodel/lib/active_model
parente7627d2af341def8a8c5786321298db6dc7b9eb3 (diff)
parent47628ec12816fb47f2decdfa8733362d6ef31d22 (diff)
downloadrails-06b9c905a9e18bb6da7cc95e53870b7493137305.tar.gz
rails-06b9c905a9e18bb6da7cc95e53870b7493137305.tar.bz2
rails-06b9c905a9e18bb6da7cc95e53870b7493137305.zip
Merge pull request #4930 from ask4prasath/ordered_hash_replaced
Replacing ordered hash to ruby hash on active model
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/errors.rb7
-rw-r--r--activemodel/lib/active_model/validations.rb2
2 files changed, 4 insertions, 5 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index 75feba1fe7..e548aa975d 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -4,12 +4,11 @@ require 'active_support/core_ext/array/conversions'
require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/hash/reverse_merge'
-require 'active_support/ordered_hash'
module ActiveModel
# == Active Model Errors
#
- # Provides a modified +OrderedHash+ that you can include in your object
+ # Provides a modified +Hash+ that you can include in your object
# for handling error messages and interacting with Action Pack helpers.
#
# A minimal implementation could be:
@@ -75,7 +74,7 @@ module ActiveModel
# end
def initialize(base)
@base = base
- @messages = ActiveSupport::OrderedHash.new
+ @messages = {}
end
def initialize_dup(other)
@@ -206,7 +205,7 @@ module ActiveModel
to_a.to_xml options.reverse_merge(:root => "errors", :skip_types => true)
end
- # Returns an ActiveSupport::OrderedHash that can be used as the JSON representation for this object.
+ # Returns an Hash that can be used as the JSON representation for this object.
def as_json(options=nil)
to_hash
end
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb
index 15b8e824ac..0e15155b85 100644
--- a/activemodel/lib/active_model/validations.rb
+++ b/activemodel/lib/active_model/validations.rb
@@ -33,7 +33,7 @@ module ActiveModel
# person.first_name = 'zoolander'
# person.valid? # => false
# person.invalid? # => true
- # person.errors # => #<OrderedHash {:first_name=>["starts with z."]}>
+ # person.errors # => #<Hash {:first_name=>["starts with z."]}>
#
# Note that <tt>ActiveModel::Validations</tt> automatically adds an +errors+ method
# to your instances initialized with a new <tt>ActiveModel::Errors</tt> object, so