Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Rework on store logo's path and default image #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/models/spree/store_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ module Spree
has_attached_file :logo,
styles: { mini: '48x48>', small: '100x100>', medium: '250x250>' },
default_style: :medium,
url: 'stores/:id/:style/:basename.:extension',
path: 'stores/:id/:style/:basename.:extension',
default_url: '/default/spree/stores/noimage.png',
url: '/spree/stores/:id/:style/:basename.:extension',
path: ':rails_root/public/spree/stores/:id/:style/:basename.:extension',
convert_options: { all: '-strip -auto-orient' }

if respond_to? :logo_file_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ def add_migrations
run 'rake railties:install:migrations FROM=spree_multi_domain'
end

def add_store_default_logo
template '../templates/noimage.png', 'public/default/spree/stores/noimage.png'
end

def run_migrations
run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask 'Would you like to run the migrations now? [Y/n]')
if run_migrations
Expand All @@ -19,6 +23,10 @@ def run_migrations
puts 'Skipping rake db:migrate, don\'t forget to run it!'
end
end

def self.source_root
File.expand_path('../templates', __FILE__)
end
end
end
end
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.