class Mv::Core::Validation::Absence

Public Class Methods

new(table_name, column_name, opts) click to toggle source
Calls superclass method
# File lib/mv/core/validation/absence.rb, line 11
def initialize(table_name, column_name, opts)
  super(table_name, column_name, opts == true ? {} : opts)
end

Protected Instance Methods

default_allow_blank() click to toggle source
# File lib/mv/core/validation/absence.rb, line 21
def default_allow_blank
  true
end
default_allow_nil() click to toggle source
# File lib/mv/core/validation/absence.rb, line 17
def default_allow_nil
  true
end
default_message() click to toggle source
# File lib/mv/core/validation/absence.rb, line 25
def default_message
  'must be blank'
end

Private Instance Methods

nil_and_blank_can_not_be_both_denied() click to toggle source
# File lib/mv/core/validation/absence.rb, line 31
def nil_and_blank_can_not_be_both_denied
  if !(allow_blank || allow_nil)
    errors.add(:allow_blank, 'can not be denied when nil is denied')
  end
end