diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-03-20 17:36:22 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-03-20 17:36:22 +0000 |
commit | 37283a6aaec244cb484e24b3e9ff165e89eadd64 (patch) | |
tree | c7fc73588629c15546428ed1462b254f9e7948b2 /activemodel/lib/active_model | |
parent | 4367f39dea7eedb1bf6e7f52b4522c695befe1da (diff) | |
download | rails-37283a6aaec244cb484e24b3e9ff165e89eadd64.tar.gz rails-37283a6aaec244cb484e24b3e9ff165e89eadd64.tar.bz2 rails-37283a6aaec244cb484e24b3e9ff165e89eadd64.zip |
Deprecate Error#on(attribute) in favour of Errors#[attribute]
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/deprecated_error_methods.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activemodel/lib/active_model/deprecated_error_methods.rb b/activemodel/lib/active_model/deprecated_error_methods.rb index c3cc1d53ae..39c79bb0c6 100644 --- a/activemodel/lib/active_model/deprecated_error_methods.rb +++ b/activemodel/lib/active_model/deprecated_error_methods.rb @@ -1,10 +1,10 @@ module ActiveModel module DeprecatedErrorMethods def on(attribute) - # 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) + 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 |