app/controllers/groups_controller.rb
def show
    @products = @group.products.joins(:employee_products).where(
        :employee_products => {:fiscal_year_id => @year.id, 
        :employee_id => @employees.pluck("employees.id")}
        ).uniq.order(:name).paginate(:page => params[:products_page], 
        :per_page => session[:results_per_page])
    @portfolios = Portfolio.includes(:product_group_portfolios =>
        :product).where(:product_group_portfolios => {
        :group_id => @group.id}).order("portfolios.name", "products.name").uniq
    @total_product_allocation = @group.get_total_product_allocation(@year, @allocation_precision)
    @total_service_allocation = @group.get_total_service_allocation(@year, @allocation_precision)
  end
# Page for viewing an existing group
Page for viewing an existing group
Page for viewing an existing group
def show
    @products = @group.products.joins(:employee_products).where(
        :employee_products => {:fiscal_year_id => @year.id, 
        :employee_id => @employees.pluck("employees.id")}
        ).uniq.order(:name).paginate(:page => params[:products_page], 
        :per_page => session[:results_per_page])
    @portfolios = Portfolio.includes(:product_group_portfolios =>
        :product).where(:product_group_portfolios => {
        :group_id => @group.id}).order("portfolios.name", "products.name").uniq
    @total_product_allocation = @group.get_total_product_allocation(@year, @allocation_precision)
    @total_service_allocation = @group.get_total_service_allocation(@year, @allocation_precision)
  end
def show @products = @group . products . joins ( :employee_products ) . where ( :employee_products => { :fiscal_year_id => @year . id , :employee_id => @employees . pluck ( "employees.id" ) } ) . uniq . order ( :name ) . paginate ( :page => params [ :products_page ] , :per_page => session [ :results_per_page ] ) @portfolios = Portfolio . includes ( :product_group_portfolios => :product ) . where ( :product_group_portfolios => { :group_id => @group . id } ) . order ( "portfolios.name" , "products.name" ) . uniq @total_product_allocation = @group . get_total_product_allocation ( @year , @allocation_precision ) @total_service_allocation = @group . get_total_service_allocation ( @year , @allocation_precision ) end
Page for viewing an existing group
Page for viewing an existing group