Class: IsAnEntryValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/el_finder_api/el_vfs/command.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



16
17
18
# File 'lib/el_finder_api/el_vfs/command.rb', line 16

def validate_each(record, attribute, value)
  record.errors[attribute] << "must be an instance of ElVfs::Entry (was #{value.class})" unless value.is_a?(ElVfs::Entry)
end