From cccbac6df6de18b98e300fdd973758447446dbee Mon Sep 17 00:00:00 2001 From: lulalala Date: Tue, 3 Apr 2018 00:17:45 +0800 Subject: Add a transitional method `objects`, for accessing the array directly. This is because we try to accommodate old hash behavior, so `first` and `last` now does not return Error object. --- activemodel/lib/active_model/errors.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activemodel/lib') diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb index 98e16ea455..805d042cac 100644 --- a/activemodel/lib/active_model/errors.rb +++ b/activemodel/lib/active_model/errors.rb @@ -74,6 +74,7 @@ module ActiveModel self.i18n_customize_full_message = false attr_reader :errors + alias :objects :errors # Pass in the instance of the object that is using the errors object. # -- cgit v1.2.3