Sha256: b67c43e81ac554346f4e8259864c75d4d2b0999db170c1f25968635265c4a08a

Contents?: true

Size: 404 Bytes

Versions: 17

Compression:

Stored size: 404 Bytes

Contents

module Refinery
  module Images
    module Validators
      class ImageUpdateValidator < ActiveModel::Validator

        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

      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
refinerycms-images-4.0.3 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-4.0.2 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-4.0.1 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-3.0.6 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-4.0.0 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-3.0.5 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-3.0.4 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-3.0.3 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-3.0.2 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-3.0.1 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-3.0.0 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-2.1.5 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-2.1.4 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-2.1.3 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-2.1.2 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-2.1.1 lib/refinery/images/validators/image_update_validator.rb
refinerycms-images-2.1.0 lib/refinery/images/validators/image_update_validator.rb