From a48e5f6df9d3dbb249b40590e2fa665ba1e357d2 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Thu, 24 May 2018 18:43:44 +0200 Subject: [PATCH] Skip image size validation for widget cards --- app/models/image.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/image.rb b/app/models/image.rb index 99061f6f1..25cf449bd 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -68,6 +68,8 @@ class Image < ActiveRecord::Base def validate_image_dimensions if attachment_of_valid_content_type? + return true if imageable_class == Widget::Card + dimensions = Paperclip::Geometry.from_file(attachment.queued_for_write[:original].path) errors.add(:attachment, :min_image_width, required_min_width: MIN_SIZE) if dimensions.width < MIN_SIZE errors.add(:attachment, :min_image_height, required_min_height: MIN_SIZE) if dimensions.height < MIN_SIZE