]> git.openstreetmap.org Git - rails.git/blob - app/validators/image_validator.rb
Bump rubocop-capybara from 2.22.1 to 2.23.0 in the rubocop group
[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