Module: TableSchema::Constraints::Required

Included in:
TableSchema::Constraints
Defined in:
lib/tableschema/constraints/required.rb

Instance Method Summary collapse

Instance Method Details

#check_requiredObject



5
6
7
8
9
10
# File 'lib/tableschema/constraints/required.rb', line 5

def check_required
  if parsed_required == true && value_is_empty?
    raise TableSchema::ConstraintError.new("The field `#{@field[:name]}` requires a value")
  end
  true
end