mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-22 11:42:19 -05:00
6 lines
212 B
Ruby
6 lines
212 B
Ruby
class ExistingPathValidator < ActiveModel::EachValidator
|
|
def validate_each(record, attribute, value)
|
|
record.errors.add attribute, "could not be found on disk" if value.nil? || !File.exist?(value)
|
|
end
|
|
end
|