openstreetmap-website/app/validators/image_validator.rb
2021-02-16 17:37:18 +00:00

5 lines
180 B
Ruby

class ImageValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
record.errors.add(attribute, " must be an image") unless value.image?
end
end