diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-02-01 04:11:24 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-02-01 04:11:24 +0000 |
commit | 1f8f982ee04fa8ae53dfc6faba2c0761d506ea70 (patch) | |
tree | bd944338fffa0ec02a7bf3d9cff92cf659a734a1 /activerecord/lib | |
parent | 26761d6d323a3f4071bdc009058fb213e9c87718 (diff) | |
download | rails-1f8f982ee04fa8ae53dfc6faba2c0761d506ea70.tar.gz rails-1f8f982ee04fa8ae53dfc6faba2c0761d506ea70.tar.bz2 rails-1f8f982ee04fa8ae53dfc6faba2c0761d506ea70.zip |
Added Errors#any? to mean !Errors#empty? [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/validations.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 27ca8d37d1..30f41530b0 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -147,6 +147,11 @@ module ActiveRecord def empty? return @errors.empty? end + + # Returns true if errors have been added. + def any? + !empty? + end # Removes all the errors that have been added. def clear |