app/models/service.rb
# Returns multiple nested arrays. The innermost nested array contains the full names of all
# the employees who both posess this service and belong to the given group, and the corresponding
# allocations that those employees have for this service. The allocation values are rounded to 
# one decimal.
Returns multiple nested arrays. The innermost nested array contains the full names of all
the employees who both posess this service and belong to the given group, and the corresponding
allocations that those employees have for this service. The allocation values are rounded to
one decimal.
Returns multiple nested arrays . The innermost nested array contains the full names of all the employees who both posess this service and belong to the given group and the corresponding allocations that those employees have for this service . The allocation values are rounded to one decimal .
def employee_allocations_within_group(group, year, allocation_precision)
    array_of_employees_and_allocations = []
    EmployeeAllocation.joins(:employee => :groups
                     ).where(:service_id => self.id, :fiscal_year_id => year.id, 
                             :groups => {:id => group.id}
                     ).each do |employee_allocation|
      array_of_employees_and_allocations << ["#{employee_allocation.employee.full_name}",   
      employee_allocation.rounded_allocation(allocation_precision), nil]
    end
    return array_of_employees_and_allocations    
  end
def employee_allocations_within_group ( group , year , allocation_precision ) array_of_employees_and_allocations = [ ] EmployeeAllocation . joins ( :employee => :groups ) . where ( :service_id => self . id , :fiscal_year_id => year . id , :groups => { :id => group . id } ) . each do | employee_allocation | array_of_employees_and_allocations << [ "#{employee_allocation.employee.full_name}" , employee_allocation . rounded_allocation ( allocation_precision ) , nil ] end return array_of_employees_and_allocations end
Returns multiple nested arrays.
Returns multiple nested arrays .
group
year
allocation_precision