update reduce loading

This commit is contained in:
Aung Myo
2018-07-04 14:24:31 +06:30
parent 4750f03ea8
commit 69333505e7
6 changed files with 31 additions and 32 deletions

View File

@@ -17,8 +17,8 @@ class ShiftSale < ApplicationRecord
belongs_to :employee, :foreign_key => 'employee_id'
def self.current_shift
today_date = DateTime.now.strftime("%Y-%m-%d")
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null").take
# today_date = DateTime.now.strftime("%Y-%m-%d")
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null").first
return shift
end