diff --git a/app/controllers/origami/addorders_controller.rb b/app/controllers/origami/addorders_controller.rb index f5bb7d37..0e905724 100755 --- a/app/controllers/origami/addorders_controller.rb +++ b/app/controllers/origami/addorders_controller.rb @@ -1,6 +1,6 @@ class Origami::AddordersController < BaseOrigamiController # before_action :set_dining, only: [:detail] - + def index @tables = Table.all.active.order('zone_id asc').group("zone_id") @rooms = Room.all.active.order('zone_id asc').group("zone_id") diff --git a/app/controllers/origami/quick_service_controller.rb b/app/controllers/origami/quick_service_controller.rb index 44dcfcb8..8abcfcc8 100644 --- a/app/controllers/origami/quick_service_controller.rb +++ b/app/controllers/origami/quick_service_controller.rb @@ -1,6 +1,12 @@ class Origami::QuickServiceController < ApplicationController # before_action :set_dining, only: [:detail] - + before_action :check_user + def check_user + if current_user.nil? + redirect_to root_path + end + end + def index today = DateTime.now day = Date.today.wday @@ -211,6 +217,11 @@ class Origami::QuickServiceController < ApplicationController end end + def check_user + if current_user.nil? + redirect_to root_path + end + end # this can always true def check_order_with_booking(booking) if booking.sale.sale_status == "completed" || booking.sale.sale_status == "new" diff --git a/app/controllers/origami/request_bills_controller.rb b/app/controllers/origami/request_bills_controller.rb index adfe35a6..e2553a83 100755 --- a/app/controllers/origami/request_bills_controller.rb +++ b/app/controllers/origami/request_bills_controller.rb @@ -1,5 +1,11 @@ class Origami::RequestBillsController < ApplicationController - + before_action :check_user + + def check_user + if current_user.nil? + redirect_to root_path + end + end # Print Request Bill and add to sale tables def print @sale = Sale.new