fixed image extensions to fit capital leters

This commit is contained in:
Mini Robot 2018-04-22 10:54:46 +02:00
parent d27b46a81b
commit 73e8a8b4ed
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ class Image < ApplicationRecord
}
# before_post_process :rename_file
validates_attachment_content_type :image, content_type: /\Aimage/
validates_attachment_file_name :image, matches: [/png\z/, /jpe?g\z/]
validates_attachment_file_name :image, matches: [/png\z/, /jpe?g\z/, /PNG\z/, /JPE?G\z/]
do_not_validate_attachment_file_type :image
scope :by_image_type, ->(type) { where(imageable_type: type) }
scope :by_position_desc, -> { order(position: :desc) }