fixed conflict

This commit is contained in:
Nweni
2017-06-28 12:58:27 +06:30
36 changed files with 309 additions and 1 deletions

View File

@@ -19,9 +19,11 @@ class HomeController < ApplicationController
if @employee != nil
session[:session_token] = @employee.token_session
#if cashier => already opening cahshier?
redirect_to origami_root_path
route_by_role(@employee)
else
render :show, flash[:notice] => "Invalid PIN for Employee. Please try again!"
end
@@ -76,4 +78,25 @@ class HomeController < ApplicationController
def settings_home_params
params.require(:login_form).permit(:emp_id, :password)
end
def route_by_role(employee)
if employee.role == "administrator"
redirect_to dashboard_path
elsif employee.role == "cashier"
#check if cashier has existing open cashier
# if !ShiftSale.current_open_shift(employee).nil?
# redirect_to origami_root_path
# else
redirect_to new_origami_shift_path
# end
elsif employee.role == "checker"
redirect_to oqs_root_path
elsif employee.role == "waiter"
redirect_to oqs_root_path
elsif employee.role == "crm"
redirect_to crm_root_path
end
end
end