Class: ESS::Validation::UnitMandatoryIfRecurrent

Inherits:
Object
  • Object
show all
Defined in:
lib/ess/validation.rb

Instance Method Summary collapse

Instance Method Details

#validate(item_tag) ⇒ Object



821
822
823
824
825
826
827
# File 'lib/ess/validation.rb', line 821

def validate item_tag
  if item_tag.type_attr == "recurrent"
    unless item_tag.unit_attr != ""
      raise ValidationError, "the \"unit\" attribute is mandatory in a date item if type is recurrent"
    end
  end
end