diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-05-15 09:32:46 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-05-15 09:32:46 -0700 |
commit | 9a868a01b8449fe9bedaee3d4c946f8409b42417 (patch) | |
tree | 54de3b7bc8724f47537949ef60d995ec1c2af670 /activemodel/lib/active_model | |
parent | 007539d12d64764db3f7fd13f134804e233ac99d (diff) | |
parent | 396e383286ccc368b54e980e06a506d339843594 (diff) | |
download | rails-9a868a01b8449fe9bedaee3d4c946f8409b42417.tar.gz rails-9a868a01b8449fe9bedaee3d4c946f8409b42417.tar.bz2 rails-9a868a01b8449fe9bedaee3d4c946f8409b42417.zip |
Merge pull request #6324 from acapilleri/dup_validation_3_2
Dup validation 3 2
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/validations.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb index 8ed392abca..1d39f2357f 100644 --- a/activemodel/lib/active_model/validations.rb +++ b/activemodel/lib/active_model/validations.rb @@ -165,6 +165,12 @@ module ActiveModel 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 @errors ||= Errors.new(self) |