class Bodhi::RequiredValidator

Public Class Methods

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

Public Instance Methods

to_options() click to toggle source
# File lib/bodhi-slam/validators/required.rb, line 10
def to_options
  {self.to_sym => true}
end
validate(record, attribute, value) click to toggle source
# File lib/bodhi-slam/validators/required.rb, line 6
def validate(record, attribute, value)
  record.errors.add(attribute, "is required") if value.nil?
end