[#42] include to list owned & assigneed issues

This commit is contained in:
Alexander Machehin 2013-04-16 01:19:53 +06:00
parent daabc12c65
commit d05f9d6764
1 changed files with 4 additions and 2 deletions

View File

@ -16,13 +16,15 @@ class Api::V1::IssuesController < Api::V1::BaseController
def all_index
project_ids = Project.accessible_by(current_ability, :membered).pluck(:id)
@issues = Issue.where(:project_id => project_ids)
@issues = Issue.where('issues.project_id IN (?) OR issues.assignee_id = ? OR issues.user_id = ?',
project_ids, current_user, current_user)
render_issues_list
end
def user_index
project_ids = current_user.projects.pluck(:id)
@issues = Issue.where(:project_id => project_ids)
@issues = Issue.where('issues.project_id IN (?) OR issues.assignee_id = ? OR issues.user_id = ?',
project_ids, current_user, current_user)
render_issues_list
end