update inventory and shop and seed

This commit is contained in:
Aung Myo
2018-10-09 16:12:52 +06:30
parent 1816b76028
commit 87502ec0f2
17 changed files with 92 additions and 75 deletions

View File

@@ -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