Class/Module Index [+]

Quicksearch

ActiveModel::Validations::ExclusionValidator

Public Instance Methods

check_validity!() click to toggle source
# File lib/active_model/validations/exclusion.rb, line 6
def check_validity!
  raise ArgumentError, "An object with the method include? is required must be supplied as the " <<
                       ":in option of the configuration hash" unless options[:in].respond_to?(:include?)
end
validate_each(record, attribute, value) click to toggle source
# File lib/active_model/validations/exclusion.rb, line 11
def validate_each(record, attribute, value)
  if options[:in].include?(value)
    record.errors.add(attribute, :exclusion, options.except(:in).merge!(:value => value))
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.