class Bodhi::MultiValidator

Public Class Methods

new(value) click to toggle source
# File lib/bodhi-slam/validators/multi.rb, line 4
def initialize(value); end

Public Instance Methods

to_options() click to toggle source
# File lib/bodhi-slam/validators/multi.rb, line 14
def to_options
  {self.to_sym => true}
end
validate(record, attribute, value) click to toggle source
# File lib/bodhi-slam/validators/multi.rb, line 6
def validate(record, attribute, value)
  if value.nil?
    #do nothing
  else
    record.errors.add(attribute, "must be an array") unless value.is_a? Array
  end
end