instance method validate_each

Ruby on Rails 3.1.12

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]
          regexp = option_call(record, :with)
          record_error(record, attribute, :with, value) if value.to_s !~ regexp
        elsif options[:without]
          regexp = option_call(record, :without)
          record_error(record, attribute, :without, value) if value.to_s =~ regexp
        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