Commit 12c3962f authored by Marin Jankovski's avatar Marin Jankovski

Search within project.

parent 0a4283b5
...@@ -136,7 +136,7 @@ class ProjectsController < ApplicationController ...@@ -136,7 +136,7 @@ class ProjectsController < ApplicationController
emojis: Emoji.names.map { |e| { name: e, path: view_context.image_url("emoji/#{e}.png") } }, emojis: Emoji.names.map { |e| { name: e, path: view_context.image_url("emoji/#{e}.png") } },
issues: @project.issues.select([:iid, :title, :description]), issues: @project.issues.select([:iid, :title, :description]),
mergerequests: @project.merge_requests.select([:iid, :title, :description]), mergerequests: @project.merge_requests.select([:iid, :title, :description]),
members: participants members: participants.uniq
} }
respond_to do |format| respond_to do |format|
...@@ -174,8 +174,10 @@ class ProjectsController < ApplicationController ...@@ -174,8 +174,10 @@ class ProjectsController < ApplicationController
def participants_in(type, id) def participants_in(type, id)
users = case type users = case type
when "Issue", "MergeRequest" when "Issue"
type.constantize.find_by_iid(id).participants @project.issues.find_by_iid(id).participants
when "MergeRequest"
@project.merge_requests.find_by_iid(id).participants
when "Commit" when "Commit"
author_ids = Note.for_commit_id(id).pluck(:author_id).uniq author_ids = Note.for_commit_id(id).pluck(:author_id).uniq
User.where(id: author_ids) User.where(id: author_ids)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment