class Mixture::Validate::Exclusion

Checks to make sure that the value isn't in the given set. This uses the `#includes?` method on the `@options`.

Public Instance Methods

validate(record, attribute, value) click to toggle source

Performs the validation.

@param (see Base#validate) @return (see Base#validate)

Calls superclass method Mixture::Validate::Base#validate
# File lib/mixture/validate/exclusion.rb, line 14
def validate(record, attribute, value)
  super
  error("Value is in the given set") if
    @options[:in].include?(value)
end