Rubocop autocorrect

This commit is contained in:
Luis Ramos
2020-08-06 11:27:31 +01:00
parent 13f0a46bc2
commit 5958c2f68c
4 changed files with 10 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Spree
module Admin
module ImagesHelper
@@ -15,4 +17,3 @@ module Spree
end
end
end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Spree
class Asset < ActiveRecord::Base
belongs_to :viewable, polymorphic: true, touch: true

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Spree
class Image < Asset
validates_attachment_presence :attachment
@@ -23,7 +25,7 @@ module Spree
Spree::Image.attachment_definitions[:attachment][:default_url] = Spree::Config[:attachment_default_url]
Spree::Image.attachment_definitions[:attachment][:default_style] = Spree::Config[:attachment_default_style]
#used by admin products autocomplete
# used by admin products autocomplete
def mini_url
attachment.url(:mini, false)
end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
describe Spree::Asset do
@@ -6,7 +8,7 @@ describe Spree::Asset do
product = create(:custom_product)
asset = Spree::Asset.create! { |a| a.viewable = product.master }
product.update_column(:updated_at, 1.day.ago)
product.update_column(:updated_at, 1.day.ago)
expect do
asset.touch