diff --git a/app/controllers/api/api_controller.rb b/app/controllers/api/api_controller.rb index 0cf85065..c60b3f0f 100755 --- a/app/controllers/api/api_controller.rb +++ b/app/controllers/api/api_controller.rb @@ -1,4 +1,5 @@ class Api::ApiController < ActionController::API + include MultiTenancy include TokenVerification include ActionController::MimeResponds diff --git a/app/controllers/base_controller.rb b/app/controllers/base_controller.rb index 22cbf130..1bb0421e 100755 --- a/app/controllers/base_controller.rb +++ b/app/controllers/base_controller.rb @@ -1,7 +1,6 @@ class BaseController < ActionController::Base include MultiTenancy - layout "installation" - protect_from_forgery with: :exception + end diff --git a/app/controllers/base_crm_controller.rb b/app/controllers/base_crm_controller.rb index 577c387e..1f6ad484 100755 --- a/app/controllers/base_crm_controller.rb +++ b/app/controllers/base_crm_controller.rb @@ -1,7 +1,7 @@ class BaseCrmController < ActionController::Base + include MultiTenancy include LoginVerification - layout "CRM" before_action :check_user diff --git a/app/controllers/base_inventory_controller.rb b/app/controllers/base_inventory_controller.rb index 45fa8954..b591fe85 100755 --- a/app/controllers/base_inventory_controller.rb +++ b/app/controllers/base_inventory_controller.rb @@ -1,7 +1,7 @@ class BaseInventoryController < ActionController::Base + include MultiTenancy include LoginVerification - layout "inventory" before_action :check_user diff --git a/app/controllers/base_oqs_controller.rb b/app/controllers/base_oqs_controller.rb index 6b01383d..776f8749 100755 --- a/app/controllers/base_oqs_controller.rb +++ b/app/controllers/base_oqs_controller.rb @@ -1,7 +1,8 @@ class BaseOqsController < ActionController::Base + include MultiTenancy include LoginVerification - + layout "OQS" before_action :check_user diff --git a/app/controllers/base_origami_controller.rb b/app/controllers/base_origami_controller.rb index e3daff76..cd011ca4 100755 --- a/app/controllers/base_origami_controller.rb +++ b/app/controllers/base_origami_controller.rb @@ -1,7 +1,7 @@ class BaseOrigamiController < ActionController::Base + include MultiTenancy include LoginVerification - layout "origami" before_action :check_user diff --git a/app/controllers/base_report_controller.rb b/app/controllers/base_report_controller.rb index a4c7c3c3..021d29c6 100755 --- a/app/controllers/base_report_controller.rb +++ b/app/controllers/base_report_controller.rb @@ -1,7 +1,7 @@ class BaseReportController < ActionController::Base + include MultiTenancy include LoginVerification - layout "application" before_action :check_user diff --git a/app/controllers/base_waiter_controller.rb b/app/controllers/base_waiter_controller.rb index 0962b3f0..598b93d6 100755 --- a/app/controllers/base_waiter_controller.rb +++ b/app/controllers/base_waiter_controller.rb @@ -1,7 +1,7 @@ class BaseWaiterController < ActionController::Base + include MultiTenancy include LoginVerification - layout "waiter" before_action :check_user diff --git a/app/controllers/concerns/multi_tenancy.rb b/app/controllers/concerns/multi_tenancy.rb index cb7c8aae..5009e094 100644 --- a/app/controllers/concerns/multi_tenancy.rb +++ b/app/controllers/concerns/multi_tenancy.rb @@ -4,6 +4,7 @@ module MultiTenancy included do set_current_tenant_through_filter if respond_to? :set_current_tenant_through_filter before_action :find_shop_by_subdomain_or_frist if respond_to? :before_action + helper_method :current_shop if respond_to? :helper_method end private diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index 910fedf9..ac105209 100755 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -4,6 +4,7 @@ class Origami::HomeController < BaseOrigamiController def index @webview = check_mobile + @tables = Table.unscope(:order).includes(:zone).all.active.order('status desc') @rooms = Room.unscope(:order).includes(:zone).all.active.order('status desc') @complete = Sale.completed_sale("cashier")