Corregge validazione upload copertina e generazione slate al go-live.

Rifiuta file troppo grandi o non-immagine via Marcel prima di attach, e genera la slate in sync anche quando cover_image esiste ma cover_slate non è ancora pronta.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-20 09:51:33 +02:00
co-authored by Cursor
parent 41d4235258
commit e09b3ffcf8
7 changed files with 50 additions and 8 deletions
+2 -2
View File
@@ -8,8 +8,8 @@ module Coverable
has_one_attached :cover_image
has_one_attached :cover_slate
validate :cover_image_file_type, if: -> { cover_image.attached? && cover_image.blob&.new_record? }
validate :cover_image_file_size, if: -> { cover_image.attached? && cover_image.blob&.new_record? }
validate :cover_image_file_type, if: -> { cover_image.attached? }
validate :cover_image_file_size, if: -> { cover_image.attached? }
end
def cover_image_attached?