lessen db calls

This commit is contained in:
Tyrel Souza 2014-11-07 16:20:02 -05:00
parent 22f913e389
commit 292b58180d

View File

@ -5,10 +5,10 @@ class ProjectsController < ApplicationController
# GET /projects.json
def index
@projects = Project.all
@active_projects = Project.where(status: Project.status_keys[:active])
@upcoming_projects = Project.where(status: Project.status_keys[:upcoming])
@backlog_projects = Project.where(status: Project.status_keys[:backlog])
@completed_projects = Project.where(status: Project.status_keys[:completed])
@active_projects = @projects.where(status: Project.status_keys[:active])
@upcoming_projects = @projects.where(status: Project.status_keys[:upcoming])
@backlog_projects = @projects.where(status: Project.status_keys[:backlog])
@completed_projects = @projects.where(status: Project.status_keys[:completed])
end
# GET /projects/1