[#42] some refactoring
This commit is contained in:
parent
03e2057a5a
commit
db89e39bf5
|
@ -27,7 +27,7 @@ class Api::V1::IssuesController < Api::V1::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def group_index
|
def group_index
|
||||||
project_ids = @group.projects.pluck(:id).uniq
|
project_ids = @group.projects.uniq.pluck(:id)
|
||||||
@issues = Issue.where(:project_id => project_ids)
|
@issues = Issue.where(:project_id => project_ids)
|
||||||
render_issues_list
|
render_issues_list
|
||||||
end
|
end
|
||||||
|
@ -101,8 +101,8 @@ class Api::V1::IssuesController < Api::V1::BaseController
|
||||||
if ['created', 'all'].include? params[:filter]
|
if ['created', 'all'].include? params[:filter]
|
||||||
# add own issues
|
# add own issues
|
||||||
project_ids = Project.accessible_by(current_ability, :show).joins(:issues).
|
project_ids = Project.accessible_by(current_ability, :show).joins(:issues).
|
||||||
where(:issues => {:user_id => current_user.id}).pluck('projects.id').uniq
|
where(:issues => {:user_id => current_user.id}).uniq.pluck('projects.id')
|
||||||
end
|
end
|
||||||
project_ids |= default_projects.pluck(:id).uniq
|
project_ids |= default_projects.uniq.pluck(:id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue