Merge pull request #478 from abf/rosa-build:247-refactoring_issues_page

refactoring an issues page
This commit is contained in:
avokhmin 2015-05-19 19:15:07 +04:00
commit d3b42dc752
1 changed files with 2 additions and 2 deletions

View File

@ -39,8 +39,8 @@ class HomeController < ApplicationController
def issues def issues
@created_issues = current_user.issues @created_issues = current_user.issues
@assigned_issues = Issue.where(assignee_id: current_user.id) @assigned_issues = Issue.where(assignee_id: current_user.id)
pr_ids = ProjectPolicy::Scope.new(current_user, Project).membered.uniq.pluck(:id) @all_issues = ProjectPolicy::Scope.new(current_user, Issue).membered.uniq.joins(:project)
@all_issues = Issue.where(project_id: pr_ids)
@created_issues, @assigned_issues, @all_issues = @created_issues, @assigned_issues, @all_issues =
if action_name == 'issues' if action_name == 'issues'
[@created_issues.without_pull_requests, [@created_issues.without_pull_requests,