update inventory and shop and seed
This commit is contained in:
@@ -15,15 +15,15 @@ class MenuItemImageUploader < CarrierWave::Uploader::Base
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
"image/menu_images/#{Shop.find(1).shop_code}"
|
||||
"image/menu_images/#{current_shop.shop_code}"
|
||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
def filename
|
||||
if Shop.find(1).shop_code.nil?
|
||||
if current_shop.shop_code.nil?
|
||||
"#{original_filename}" if original_filename.present?
|
||||
else
|
||||
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||
"#{current_shop.shop_code}_#{original_filename}" if original_filename.present?
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user