aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-03-20 15:27:55 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-03-20 15:27:55 +0000
commitcda984d3140d3ba1ab442b38acc12b9e29f92cd2 (patch)
tree894b67c9f27804e2ef76f82018686af678d1fcec /activemodel
parent60756ad4ece2298e85353ed50853f1d260e0d27a (diff)
downloadrails-cda984d3140d3ba1ab442b38acc12b9e29f92cd2.tar.gz
rails-cda984d3140d3ba1ab442b38acc12b9e29f92cd2.tar.bz2
rails-cda984d3140d3ba1ab442b38acc12b9e29f92cd2.zip
Future deprecation message
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/deprecated_error_methods.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/deprecated_error_methods.rb b/activemodel/lib/active_model/deprecated_error_methods.rb
index b0d7023046..c3cc1d53ae 100644
--- a/activemodel/lib/active_model/deprecated_error_methods.rb
+++ b/activemodel/lib/active_model/deprecated_error_methods.rb
@@ -1,7 +1,11 @@
module ActiveModel
module DeprecatedErrorMethods
def on(attribute)
- # ActiveSupport::Deprecation.warn "Errors#on have been deprecated, use Errors#[] instead"
+ # message = "Errors#on have been deprecated, use Errors#[] instead.\n"
+ # message << "Also note that the behaviour of Errors#[] has changed. Errors#[] now always returns an Array and an empty Array when "
+ # message << "there are not errors on the specified attribute."
+ # ActiveSupport::Deprecation.warn(message)
+
errors = self[attribute]
errors.size < 2 ? errors.first : errors
end