current shop
This commit is contained in:
@@ -18,8 +18,9 @@ class HomeController < ApplicationController
|
||||
|
||||
def index
|
||||
# @employees = Employee.all_emp_except_waiter.order("name asc")
|
||||
@employees = Employee.all.where("shop_code='#{@current_shop.shop_code}' and is_active = true").order("name asc")
|
||||
@roles = Employee.where("shop_code='#{@current_shop.shop_code}'").distinct.pluck(:role)
|
||||
shop = Shop.current_shop
|
||||
@employees = Employee.all.where("shop_code='#{shop.shop_code}' and is_active = true").order("name asc")
|
||||
@roles = Employee.where("shop_code='#{shop.shop_code}'").distinct.pluck(:role)
|
||||
|
||||
# byebug
|
||||
# @roles = Lookup.collection_of("employee_roles")
|
||||
@@ -52,7 +53,7 @@ class HomeController < ApplicationController
|
||||
@login_form = LoginForm.new()
|
||||
@login_form.emp_id = params[:login_form][:emp_id]
|
||||
@login_form.password = params[:login_form][:password]
|
||||
@employee = Employee.login(current_shop,@login_form.emp_id, @login_form.password)
|
||||
@employee = Employee.login(@login_form.emp_id, @login_form.password)
|
||||
|
||||
if @employee != nil
|
||||
if @employee.is_active
|
||||
@@ -169,7 +170,7 @@ class HomeController < ApplicationController
|
||||
|
||||
def destroy
|
||||
# clear in employee session
|
||||
Employee.logout(current_shop,session[:session_token])
|
||||
Employee.logout(session[:session_token])
|
||||
session[:session_token] = nil
|
||||
# redirect_to root_path
|
||||
render :json => {:status=> "Success", :url => root_path }.to_json
|
||||
|
||||
Reference in New Issue
Block a user