]> git.openstreetmap.org Git - rails.git/blob - app/validators/image_validator.rb
Merge pull request #5932 from tomhughes/frozen-strings
[rails.git] / app / validators / image_validator.rb
1 # frozen_string_literal: true
2
3 class ImageValidator < ActiveModel::EachValidator
4   def validate_each(record, attribute, value)
5     record.errors.add(attribute, " must be an image") unless value.image?
6   end
7 end