diff --git a/app/models/screenshot.rb b/app/models/screenshot.rb index 9fc0bd7..b4353b4 100644 --- a/app/models/screenshot.rb +++ b/app/models/screenshot.rb @@ -9,6 +9,12 @@ class Screenshot < ApplicationRecord # Validate using 'active_storage_validations' gem validates :image, attached: true, content_type: { in: 'image/png', message: 'is not a valid PNG image file' } + # Before migration from Paperclip to ActiveStorage: + #has_attached_file :image, + # styles: { :large => '800x600>', :thumb => '160x120>' }, + # default_url: '/images/dummy/no-screenshots-available.svg', + # path: ':rails_root/public/screenshots/:id_partition/:style.png', + # url: '/screenshots/:id_partition/:style.png' #validates_attachment_content_type :image, :content_type => 'image/png' #validates_with AttachmentSizeValidator, :attributes => :image, :less_than => 5.megabytes # validate :validate_image_is_unique