diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index f355c25f42..461f08f919 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -277,7 +277,7 @@ class Enterprise < ApplicationRecord end def logo_url(name) - return unless logo.attached? + return unless logo.variable? Rails.application.routes.url_helpers.url_for( logo.variant(LOGO_SIZES[name]) @@ -285,7 +285,7 @@ class Enterprise < ApplicationRecord end def promo_image_url(name) - return unless promo_image.attached? + return unless promo_image.variable? Rails.application.routes.url_helpers.url_for( promo_image.variant(PROMO_IMAGE_SIZES[name]) diff --git a/app/serializers/api/admin/enterprise_serializer.rb b/app/serializers/api/admin/enterprise_serializer.rb index 21f08a3492..2071024f3e 100644 --- a/app/serializers/api/admin/enterprise_serializer.rb +++ b/app/serializers/api/admin/enterprise_serializer.rb @@ -89,7 +89,7 @@ module Api # medium: LOGO_MEDIUM_URL # } def attachment_urls(attachment, styles) - return unless attachment.attached? + return unless attachment.variable? styles.transform_values do |transformation| Rails.application.routes.url_helpers. diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index b8eca916de..13966cba3f 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -22,10 +22,10 @@ %header .row .small-12.columns - = image_tag @group.promo_image.variant(resize_to_limit: [1200, 260]) if @group.promo_image.attached? + = image_tag @group.promo_image.variant(resize_to_limit: [1200, 260]) if @group.promo_image.variable? .row .small-12.columns.group-header.pad-top - - if @group.logo.attached? + - if @group.logo.variable? = image_tag @group.logo.variant(resize_to_limit: [100, 100]), class: "group-logo" - else = image_tag "/noimage/group.png", class: "group-logo" diff --git a/app/views/shopping_shared/_header.html.haml b/app/views/shopping_shared/_header.html.haml index 45d4d9c952..144c3fc427 100644 --- a/app/views/shopping_shared/_header.html.haml +++ b/app/views/shopping_shared/_header.html.haml @@ -4,7 +4,7 @@ %distributor.details.row .small-12.medium-12.large-8.columns #distributor_title - - if distributor.logo.attached? + - if distributor.logo.variable? = image_tag distributor.logo_url(:thumb), class: "left" = render DistributorTitleComponent.new(name: distributor.name) %location= distributor.address.city diff --git a/app/views/spree/admin/orders/invoice2.html.haml b/app/views/spree/admin/orders/invoice2.html.haml index 1e8545cfb1..be43fb767c 100644 --- a/app/views/spree/admin/orders/invoice2.html.haml +++ b/app/views/spree/admin/orders/invoice2.html.haml @@ -6,7 +6,7 @@ %td{ :align => "left" } %h4 = t :tax_invoice - - if @order.distributor.display_invoice_logo? && @order.distributor.logo.attached? + - if @order.distributor.display_invoice_logo? && @order.distributor.logo.variable? %td{ :align => "right", rowspan: 2 } = wicked_pdf_image_tag @order.distributor.logo.variant(resize_to_limit: [150, 150]) %tr{ valign: "top" } diff --git a/app/views/spree/order_mailer/cancel_email.html.haml b/app/views/spree/order_mailer/cancel_email.html.haml index 4854c417b1..edfc66f162 100755 --- a/app/views/spree/order_mailer/cancel_email.html.haml +++ b/app/views/spree/order_mailer/cancel_email.html.haml @@ -6,7 +6,7 @@ = t(".customer_greeting", name: @order.bill_address.firstname) %h4 = t(".instructions_html", distributor: @order.distributor.name ) - - if @order.distributor.logo.attached? + - if @order.distributor.logo.variable? = image_tag @order.distributor.logo_url(:medium) %p.callout diff --git a/app/views/spree/order_mailer/confirm_email_for_customer.html.haml b/app/views/spree/order_mailer/confirm_email_for_customer.html.haml index c7f1597128..8894805243 100644 --- a/app/views/spree/order_mailer/confirm_email_for_customer.html.haml +++ b/app/views/spree/order_mailer/confirm_email_for_customer.html.haml @@ -11,7 +11,7 @@ %table.column{:align => "left"} %tr %td{:align => "right"} - - if @order.distributor.logo.attached? + - if @order.distributor.logo.variable? = image_tag @order.distributor.logo_url(:medium), class: "float-right" %span.clear diff --git a/app/views/spree/order_mailer/confirm_email_for_shop.html.haml b/app/views/spree/order_mailer/confirm_email_for_shop.html.haml index a86c6cda88..0e5b4510bf 100644 --- a/app/views/spree/order_mailer/confirm_email_for_shop.html.haml +++ b/app/views/spree/order_mailer/confirm_email_for_shop.html.haml @@ -11,7 +11,7 @@ %table.column{:align => "left"} %tr %td{:align => "right"} - - if @order.distributor.logo.attached? + - if @order.distributor.logo.variable? = image_tag @order.distributor.logo_url(:medium), class: "float-right" %span.clear diff --git a/app/views/subscription_mailer/_header.html.haml b/app/views/subscription_mailer/_header.html.haml index 1f70213378..6f7a593669 100644 --- a/app/views/subscription_mailer/_header.html.haml +++ b/app/views/subscription_mailer/_header.html.haml @@ -11,6 +11,6 @@ %table.column{:align => "left"} %tr %td{:align => "right"} - - if @order.distributor.logo.attached? + - if @order.distributor.logo.variable? = image_tag @order.distributor.logo_url(:medium), class: "float-right" %span.clear diff --git a/app/views/subscription_mailer/confirmation_summary_email.html.haml b/app/views/subscription_mailer/confirmation_summary_email.html.haml index c6279620a1..4cdefdffe1 100644 --- a/app/views/subscription_mailer/confirmation_summary_email.html.haml +++ b/app/views/subscription_mailer/confirmation_summary_email.html.haml @@ -11,7 +11,7 @@ %table.column{:align => "left"} %tr %td{:align => "right"} - - if @shop.logo.attached? + - if @shop.logo.variable? = image_tag @shop.logo_url(:medium), class: "float-right" %span.clear diff --git a/app/views/subscription_mailer/placement_summary_email.html.haml b/app/views/subscription_mailer/placement_summary_email.html.haml index 292496fdc4..3c8a21baca 100644 --- a/app/views/subscription_mailer/placement_summary_email.html.haml +++ b/app/views/subscription_mailer/placement_summary_email.html.haml @@ -11,7 +11,7 @@ %table.column{:align => "left"} %tr %td{:align => "right"} - - if @shop.logo.attached? + - if @shop.logo.variable? = image_tag @shop.logo_variant(:medium), class: "float-right" %span.clear