Class: IsADirectoryValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- IsADirectoryValidator
- Defined in:
- lib/el_finder_api/el_vfs/command.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
10 11 12 |
# File 'lib/el_finder_api/el_vfs/command.rb', line 10 def validate_each(record, attribute, value) record.errors[attribute] << "must be an instance of ElVfs::Directory (was #{value.class})" unless value.is_a?(ElVfs::Directory) || value.is_a?(ElVfs::Root) end |