lessen db calls
This commit is contained in:
parent
22f913e389
commit
292b58180d
@ -5,10 +5,10 @@ class ProjectsController < ApplicationController
|
|||||||
# GET /projects.json
|
# GET /projects.json
|
||||||
def index
|
def index
|
||||||
@projects = Project.all
|
@projects = Project.all
|
||||||
@active_projects = Project.where(status: Project.status_keys[:active])
|
@active_projects = @projects.where(status: Project.status_keys[:active])
|
||||||
@upcoming_projects = Project.where(status: Project.status_keys[:upcoming])
|
@upcoming_projects = @projects.where(status: Project.status_keys[:upcoming])
|
||||||
@backlog_projects = Project.where(status: Project.status_keys[:backlog])
|
@backlog_projects = @projects.where(status: Project.status_keys[:backlog])
|
||||||
@completed_projects = Project.where(status: Project.status_keys[:completed])
|
@completed_projects = @projects.where(status: Project.status_keys[:completed])
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /projects/1
|
# GET /projects/1
|
||||||
|
Loading…
Reference in New Issue
Block a user