Use ActsAsTenant as Multi-tenancy for shops See below files: - app/controllers/concern/multi_tenancy.rb - app/models/application_record.rb - app/models/shop.rb An initializer can be created to control option in ActsAsTenant. config/initializers/acts_as_tenant.rb require 'acts_as_tenant/sidekiq' ActsAsTenant.configure do |config| config.require_tenant = false # true end more detail: https://github.com/ErwinM/acts_as_tenant
35 lines
857 B
Ruby
35 lines
857 B
Ruby
class Origami::SecondDisplayController < BaseOrigamiController
|
|
|
|
def index
|
|
@display_images = DisplayImage.all
|
|
end
|
|
|
|
def show
|
|
end
|
|
|
|
def customer_view
|
|
display_type = Lookup.find_by_lookup_type("display_type")
|
|
if !display_type.nil? && display_type.value.to_i == 2
|
|
if params[:status]!= "billed"
|
|
tax_profiles = TaxProfile.all.order("order_by asc")
|
|
else
|
|
tax_profiles = nil
|
|
end
|
|
if ENV["SERVER_MODE"] == 'cloud'
|
|
from = request.subdomain + "." + request.domain
|
|
else
|
|
from = ""
|
|
end
|
|
ActionCable.server.broadcast "second_display_view_channel",data: params[:data],tax_profiles: tax_profiles,status:params[:status],from:from
|
|
end
|
|
# end
|
|
end
|
|
#Shop Name in Navbor
|
|
# helper_method :shop_detail
|
|
# def shop_detail
|
|
# @shop = Shop.current_shop
|
|
# end
|
|
|
|
|
|
end
|