Reuse Spree::Image.set_attachment_definitions

This commit is contained in:
Luis Ramos
2020-09-18 17:43:35 +01:00
parent b66ad71017
commit fdd7049857
2 changed files with 2 additions and 9 deletions

View File

@@ -44,7 +44,7 @@ module Spree
false
end
def self.set_attachment_definitions(config)
def self.set_attachment_definitions
Spree::Image.attachment_definitions[:attachment][:styles] =
ActiveSupport::JSON.decode(Spree::Config[:attachment_styles]).symbolize_keys!
Spree::Image.attachment_definitions[:attachment][:path] = Spree::Config[:attachment_path]

View File

@@ -58,14 +58,7 @@ else
Spree::Image.attachment_definitions[:attachment].delete :storage
end
Spree::Image.attachment_definitions[:attachment][:styles] =
ActiveSupport::JSON.decode(Spree::Config[:attachment_styles]).symbolize_keys!
Spree::Image.attachment_definitions[:attachment][:path] = Spree::Config[:attachment_path]
Spree::Image.attachment_definitions[:attachment][:default_url] =
Spree::Config[:attachment_default_url]
Spree::Image.attachment_definitions[:attachment][:default_style] =
Spree::Config[:attachment_default_style]
Spree::Image.set_attachment_definitions
Spree::Image.reformat_styles
# Spree 2.0 recommends explicitly setting this here when using spree_auth_devise