lessen db calls
This commit is contained in:
parent
22f913e389
commit
292b58180d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user