diff options
| author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-12-15 15:22:33 -0200 |
|---|---|---|
| committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-12-15 15:22:33 -0200 |
| commit | ca8e14862a9f6f3ec37fb2842d76ecefd4eb2b4e (patch) | |
| tree | da4ac7e4f893b294d02f8564dfd675c0bc0046d6 /activemodel/lib | |
| parent | ff370ee61754b00f864f3ddd0af62be4dfa0de67 (diff) | |
| parent | e73fe1dd8c2740ae29e7a7f48d71a62b46e6b49d (diff) | |
| download | rails-ca8e14862a9f6f3ec37fb2842d76ecefd4eb2b4e.tar.gz rails-ca8e14862a9f6f3ec37fb2842d76ecefd4eb2b4e.tar.bz2 rails-ca8e14862a9f6f3ec37fb2842d76ecefd4eb2b4e.zip | |
Merge remote-tracking branch 'origin/master' into merge-action-cable
Diffstat (limited to 'activemodel/lib')
| -rw-r--r-- | activemodel/lib/active_model/errors.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 4726a68f69..ef6141a51d 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -81,6 +81,18 @@ module ActiveModel super end + # Copies the errors from <tt>other</tt>. + # + # other - The ActiveModel::Errors instance. + # + # Examples + # + # person.errors.copy!(other) + def copy!(other) # :nodoc: + @messages = other.messages.dup + @details = other.details.dup + end + # Clear the error messages. # # person.errors.full_messages # => ["name cannot be nil"] |
