Class/Module Index [+]

Quicksearch

ActiveModel::Validations::ExclusionValidator

Constants

ERROR_MESSAGE

Public Instance Methods

check_validity!() click to toggle source
# File lib/active_model/validations/exclusion.rb, line 11
def check_validity!
  unless [:include?, :call].any? { |method| options[:in].respond_to?(method) }
    raise ArgumentError, ERROR_MESSAGE
  end
end
validate_each(record, attribute, value) click to toggle source
# File lib/active_model/validations/exclusion.rb, line 17
def validate_each(record, attribute, value)
  delimiter = options[:in]
  exclusions = delimiter.respond_to?(:call) ? delimiter.call(record) : delimiter
  if exclusions.send(inclusion_method(exclusions), value)
    record.errors.add(attribute, :exclusion, options.except(:in).merge!(:value => value))
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.