From b677adede027eefed41f6b37096df7bbc4eb3d38 Mon Sep 17 00:00:00 2001 From: Edouard CHIN Date: Tue, 9 Jul 2019 14:40:57 +0200 Subject: 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. --- activemodel/lib/active_model.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activemodel/lib/active_model.rb') 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" -- cgit v1.2.3