class Mixture::Validate::Inclusion
Checks to make sure that the value is 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/inclusion.rb, line 14 def validate(record, attribute, value) super error("Value isn't in the given set") unless @options[:in].include?(value) end