aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model.rb
diff options
context:
space:
mode:
authorEdouard CHIN <edouard.chin@shopify.com>2019-07-09 14:40:57 +0200
committerEdouard CHIN <edouard.chin@shopify.com>2019-07-16 14:28:38 +0200
commitb677adede027eefed41f6b37096df7bbc4eb3d38 (patch)
tree4721c73ed25b7445db1ffa394ac7b6b584919d7a /activemodel/lib/active_model.rb
parent5a9301ce47f1117c8d457cad2b850f932bf7f518 (diff)
downloadrails-b677adede027eefed41f6b37096df7bbc4eb3d38.tar.gz
rails-b677adede027eefed41f6b37096df7bbc4eb3d38.tar.bz2
rails-b677adede027eefed41f6b37096df7bbc4eb3d38.zip
Move the `ActiveModel:Errors#full_message` method to the `Error` class:
- One regression introduced by the "AM errors as object" features is about the `full_messages` method. It's currently impossible to call that method if the `base` object passed in the constructor of `AM::Errors` doesn't respond to the `errors` method. That's because `full_messages` now makes a weird back and forth trip `AM::Errors#full_messages` -> `AM::Error#full_message` -> `AM::Errors#full_message` Since `full_message` (singular) isn't needed by AM::Errors, I moved it to the `AM::Error` (singular) class. This way we don't need to grab the `AM::Errors` object from the base.
Diffstat (limited to 'activemodel/lib/active_model.rb')
-rw-r--r--activemodel/lib/active_model.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activemodel/lib/active_model.rb b/activemodel/lib/active_model.rb
index c9140dc582..756473e38d 100644
--- a/activemodel/lib/active_model.rb
+++ b/activemodel/lib/active_model.rb
@@ -53,6 +53,7 @@ module ActiveModel
eager_autoload do
autoload :Errors
+ autoload :Error
autoload :RangeError, "active_model/errors"
autoload :StrictValidationFailed, "active_model/errors"
autoload :UnknownAttributeError, "active_model/errors"