Add my-schedule and some other things

This commit is contained in:
2015-08-17 19:13:35 +02:00
parent 2df1b38e8f
commit 9cadc3e94f
30 changed files with 139 additions and 23 deletions
@@ -2,7 +2,7 @@ module Suppliers
class EmployeeShiftsController < Suppliers::ApplicationController
def index
@employee_shifts = EmployeeShift.for_supplier(current_supplier, relevant_from: 1.week.ago)
@employee_shifts.include_relation(:employee)
@employee_shifts.include_relations(:employee, :supplier)
# Only select shifts from currently linked and employees
@employee_shifts.select! do |shift|
current_supplier.employee_ids.include?(shift.employee.try(:id))