Class: Noodall::Node::SlotValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/noodall/node.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



420
421
422
# File 'lib/noodall/node.rb', line 420

def validate_each(record, attribute, value)
  record.errors[attribute] << "cannnot contain  #{value.class.name.humanize}" unless value.nil? or Noodall::Component.positions_classes(options[:slot_type]).include?(value.class)
end