aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-05-15 05:20:57 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-05-15 05:20:57 -0700
commit3d1b078a5b23d03fa827779767a0f97aa3ccac4b (patch)
tree85e3a44b5c5f19ecc243da73242fe3ce183fd186 /activemodel/lib
parentdd42e8905830f96db29d49ed4bd44eeca5195de3 (diff)
parentf9ae1baa0ae47064d5100e48ffda1fe8b4fa34e7 (diff)
downloadrails-3d1b078a5b23d03fa827779767a0f97aa3ccac4b.tar.gz
rails-3d1b078a5b23d03fa827779767a0f97aa3ccac4b.tar.bz2
rails-3d1b078a5b23d03fa827779767a0f97aa3ccac4b.zip
Merge pull request #6284 from acapilleri/dup_validation
clean the erros if an object that includes validation is duped.
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/validations.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb
index 3ed72bae3b..72176e9bdd 100644
--- a/activemodel/lib/active_model/validations.rb
+++ b/activemodel/lib/active_model/validations.rb
@@ -177,6 +177,12 @@ module ActiveModel
super
end
end
+
+ # Clean the +Errors+ object if instance is duped
+ def initialize_dup(other) # :nodoc:
+ @errors = nil
+ super
+ end
# Returns the +Errors+ object that holds all information about attribute error messages.
def errors