instance method
size
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
size()
Returns the total number of errors added. Two errors added to the same attribute will be counted as such.
Source
# File activerecord/lib/active_record/validations.rb, line 226
def size
@errors.values.inject(0) { |error_count, attribute| error_count + attribute.size }
end
Defined in activerecord/lib/active_record/validations.rb line 226
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Errors