instance method size

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available 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 302
    def size
      @errors.values.inject(0) { |error_count, attribute| error_count + attribute.size }
    end

Defined in activerecord/lib/active_record/validations.rb line 302 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Errors

Type at least 2 characters to search.

↑↓ navigate · open · esc close