diff options
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/validations.rb | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 455785e7b9..096ae9eb4e 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Renamed Errors#count to Errors#size but kept an alias for the old name (and included an alias for length too) #3920 [contact@lukeredpath.co.uk] + * Reflections don't attempt to resolve module nesting of association classes. Simplify type computation. [Jeremy Kemper] * Improved the Oracle OCI Adapter with better performance for column reflection (from #3210), fixes to migrations (from #3476 and #3742), tweaks to unit tests (from #3610), and improved documentation (from #2446) #3879 [Aggregated by schoenm@earthlink.net] diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 7d1661449c..f733620298 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -155,11 +155,14 @@ module ActiveRecord # Returns the total number of errors added. Two errors added to the same attribute will be counted as such # with this as well. - def count + def size error_count = 0 @errors.each_value { |attribute| error_count += attribute.length } error_count end + + alias_method :count, :size + alias_method :length, :size end |