diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-05 17:13:07 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-05 17:13:07 +0200 |
commit | e0f30c605bbf0a92f3ddeffdd80d765a5f041a06 (patch) | |
tree | 30124a08e520d4cf4f6dcb45509892d616ef3880 /app/finders | |
parent | ed2eaf55c1c2402a0a630838901bdddbc11fda47 (diff) | |
download | gitlab-ce-e0f30c605bbf0a92f3ddeffdd80d765a5f041a06.tar.gz |
Add author filter for issues & merge requests pages
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/issuable_finder.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index d0574240511..e1477510065 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -33,6 +33,7 @@ class IssuableFinder items = by_search(items) items = by_milestone(items) items = by_assignee(items) + items = by_author(items) items = by_label(items) items = sort(items) end @@ -125,6 +126,14 @@ class IssuableFinder items end + def by_author(items) + if params[:author_id].present? + items = items.where(author_id: (params[:author_id] == '0' ? nil : params[:author_id])) + end + + items + end + def by_label(items) if params[:label_name].present? label_names = params[:label_name].split(",") |