aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorlulalala <mark@goodlife.tw>2018-04-03 00:17:45 +0800
committerlulalala <mark@goodlife.tw>2019-03-31 22:59:12 +0800
commitcccbac6df6de18b98e300fdd973758447446dbee (patch)
tree4b5565486d67716e68c20af2b12550f83c3e93fc /activemodel/lib/active_model
parent86b4aa1175b23deca15981fbc19cf7f02b13b25d (diff)
downloadrails-cccbac6df6de18b98e300fdd973758447446dbee.tar.gz
rails-cccbac6df6de18b98e300fdd973758447446dbee.tar.bz2
rails-cccbac6df6de18b98e300fdd973758447446dbee.zip
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.
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/errors.rb1
1 files changed, 1 insertions, 0 deletions
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.
#