mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-22 03:32:18 -05:00
6 lines
203 B
Ruby
6 lines
203 B
Ruby
class WritableValidator < ActiveModel::EachValidator
|
|
def validate_each(record, attribute, value)
|
|
record.errors.add attribute, :non_writable unless value.nil? || FileTest.writable?(value)
|
|
end
|
|
end
|