Class: Refinery::Images::Validators::ImageUpdateValidator
- Inherits:
-
ActiveModel::Validator
- Object
- ActiveModel::Validator
- Refinery::Images::Validators::ImageUpdateValidator
- Defined in:
- lib/refinery/images/validators/image_update_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate(record) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/refinery/images/validators/image_update_validator.rb', line 6 def validate(record) if record.image_name_changed? record.errors.add :image_name, ::I18n.t("different_file_name", :scope => "activerecord.errors.models.refinery/image") end end |