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:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user