mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-22 03:32:18 -05:00
7 lines
281 B
Ruby
7 lines
281 B
Ruby
class ExistingPathValidator < ActiveModel::EachValidator
|
|
def validate_each(record, attribute, value)
|
|
# i18n-tasks-use t("activerecord.errors.models.library.attributes.path.not_found")
|
|
record.errors.add attribute, :not_found if value.nil? || !File.exist?(value)
|
|
end
|
|
end
|