Edit Photo name in commissioner,customers,employee,menu,product and shop

This commit is contained in:
San Wai Lwin
2018-05-10 15:08:57 +06:30
parent 7cc7419b67
commit f52537b509
7 changed files with 24 additions and 7 deletions

View File

@@ -19,6 +19,10 @@ class CommissionerImageUploader < CarrierWave::Uploader::Base
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def filename
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
end
# def cache_dir
# '/tmp/images'
# end

View File

@@ -19,6 +19,10 @@ class CustomerImageUploader < CarrierWave::Uploader::Base
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def filename
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
end
# def cache_dir
# '/tmp/images'
# end

View File

@@ -19,6 +19,10 @@ class EmployeeImageUploader < CarrierWave::Uploader::Base
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def filename
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
end
# def cache_dir
# '/tmp/images'
# end

View File

@@ -19,6 +19,10 @@ class MenuItemImageUploader < CarrierWave::Uploader::Base
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def filename
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
end
# def cache_dir
# '/tmp/images'
# end

View File

@@ -19,6 +19,10 @@ class ProductImageUploader < CarrierWave::Uploader::Base
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def filename
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
end
# def cache_dir
# '/tmp/images'
# end

View File

@@ -19,6 +19,10 @@ class ShopImageUploader < CarrierWave::Uploader::Base
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def filename
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
end
# def cache_dir
# '/tmp/images'
# end

View File

@@ -1,7 +0,0 @@
redis: &redis
adapter: redis
url: redis://localhost:6379/1
production: *redis
development: *redis
test: *redis