diff options
author | José Valim <jose.valim@gmail.com> | 2010-08-29 20:45:34 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-08-29 20:45:34 -0300 |
commit | f0ee4a6002d4f7e27fb472051778eed8c4a3b47e (patch) | |
tree | 09ddff6e590efb7d2ca9ca81fbb10ffc9d593367 /activemodel/lib/active_model/deprecated_error_methods.rb | |
parent | 972efa11fd3339117e9f874beb4e85b146212c29 (diff) | |
download | rails-f0ee4a6002d4f7e27fb472051778eed8c4a3b47e.tar.gz rails-f0ee4a6002d4f7e27fb472051778eed8c4a3b47e.tar.bz2 rails-f0ee4a6002d4f7e27fb472051778eed8c4a3b47e.zip |
Remove deprecations in ActiveModel.
Diffstat (limited to 'activemodel/lib/active_model/deprecated_error_methods.rb')
-rw-r--r-- | activemodel/lib/active_model/deprecated_error_methods.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/activemodel/lib/active_model/deprecated_error_methods.rb b/activemodel/lib/active_model/deprecated_error_methods.rb deleted file mode 100644 index adc50773d9..0000000000 --- a/activemodel/lib/active_model/deprecated_error_methods.rb +++ /dev/null @@ -1,33 +0,0 @@ -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. An empty Array is " - message << "returned when there are no errors on the specified attribute." - ActiveSupport::Deprecation.warn(message) - - errors = self[attribute] - errors.size < 2 ? errors.first : errors - end - - def on_base - ActiveSupport::Deprecation.warn "Errors#on_base have been deprecated, use Errors#[:base] instead" - ActiveSupport::Deprecation.silence { on(:base) } - end - - def add_to_base(msg) - ActiveSupport::Deprecation.warn "Errors#add_to_base(msg) has been deprecated, use Errors#add(:base, msg) instead" - self[:base] << msg - end - - def invalid?(attribute) - ActiveSupport::Deprecation.warn "Errors#invalid?(attribute) has been deprecated, use Errors#[attribute].any? instead" - self[attribute].any? - end - - def each_full - ActiveSupport::Deprecation.warn "Errors#each_full has been deprecated, use Errors#to_a.each instead" - to_a.each { |error| yield error } - end - end -end |