소스 검색

added session variable when manager login

Jose Miguel Ledon Nieblas 9 년 전
부모
커밋
f044207f40
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      app/controllers/dashboard_controller.rb

+ 1 - 0
app/controllers/dashboard_controller.rb

@@ -29,6 +29,7 @@ class DashboardController < ApplicationController
         @product_ranking << obj
       end
       @product_ranking = ActionController::Base.helpers.sanitize(@product_ranking.to_json)
+      session[:open_cash_register_id] = current_user.pointsale.get_open_cash_register.id if current_user.pointsale.get_open_cash_register.present?
     elsif current_user.usertype == 'C'
       @need_to_open_cash = current_user.pointsale.can_open_cash_register?
       session[:open_cash_register_id] = current_user.pointsale.get_open_cash_register.id unless @need_to_open_cash