Files
sx-fc/app/models/shop.rb
2020-01-13 16:41:09 +06:30

18 lines
386 B
Ruby
Executable File

class Shop < ApplicationRecord
#ShopDetail = Shop.current_shop
# Shop Image Uploader
mount_uploader :logo, ShopImageUploader
has_many :display_images
accepts_nested_attributes_for :display_images
def file_data=(input_data)
self.data = input_data.read
end
def self.current_shop
RequestStore["current_shop"] ||= ActsAsTenant.current_tenant || Shop.first
end
end