Class: IsAFileValidator

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



4
5
6
# File 'lib/el_finder_api/el_vfs/command.rb', line 4

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