instance method validate_each

Ruby on Rails 3.0.20

Since v3.0.20 Last seen in v3.2.22.5

Available in: v3.0.20 v3.1.12 v3.2.22.5

Signature

validate_each(record, attribute, value)

No documentation comment.

Parameters

record req
attribute req
value req
Source
# File activemodel/lib/active_model/validations/format.rb, line 6
      def validate_each(record, attribute, value)
        if options[:with] && value.to_s !~ options[:with]
          record.errors.add(attribute, :invalid, options.except(:with).merge!(:value => value))
        elsif options[:without] && value.to_s =~ options[:without]
          record.errors.add(attribute, :invalid, options.except(:without).merge!(:value => value))
        end
      end

Defined in activemodel/lib/active_model/validations/format.rb line 6 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveModel::Validations::FormatValidator

Type at least 2 characters to search.

↑↓ navigate · open · esc close