aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-12-15 15:22:33 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-12-15 15:22:33 -0200
commitca8e14862a9f6f3ec37fb2842d76ecefd4eb2b4e (patch)
treeda4ac7e4f893b294d02f8564dfd675c0bc0046d6 /activemodel/lib/active_model
parentff370ee61754b00f864f3ddd0af62be4dfa0de67 (diff)
parente73fe1dd8c2740ae29e7a7f48d71a62b46e6b49d (diff)
downloadrails-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/active_model')
-rw-r--r--activemodel/lib/active_model/errors.rb12
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"]