diff options
author | Mark Chao <mchao@gitlab.com> | 2018-05-14 05:07:53 +0300 |
---|---|---|
committer | Mark Chao <mchao@gitlab.com> | 2018-05-21 04:55:30 +0300 |
commit | d839b880a256f208ae5a0d877765bc5fcbfcd44d (patch) | |
tree | f6314a8f0ba20856e400a34a41069d630a5f3196 /app/finders/issuable_finder.rb | |
parent | 40683268b2b5ad807194387d8345a30195e178c4 (diff) |
Add created_by_me and assigned_to_me scopes
Deprecate corresponding dash versions created-by-me and assigned-to-me
Diffstat (limited to 'app/finders/issuable_finder.rb')
-rw-r--r-- | app/finders/issuable_finder.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 7ed9b1fc6d0..c6ef79ce15e 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -6,7 +6,7 @@ # klass - actual class like Issue or MergeRequest # current_user - which user use # params: -# scope: 'created-by-me' or 'assigned-to-me' or 'all' +# scope: 'created_by_me' or 'assigned_to_me' or 'all' # state: 'opened' or 'closed' or 'all' # group_id: integer # project_id: integer @@ -282,9 +282,9 @@ class IssuableFinder return items.none if current_user_related? && !current_user case params[:scope] - when 'created-by-me', 'authored' + when 'created_by_me', 'authored' items.where(author_id: current_user.id) - when 'assigned-to-me' + when 'assigned_to_me' items.assigned_to(current_user) else items @@ -426,6 +426,7 @@ class IssuableFinder end def current_user_related? - params[:scope] == 'created-by-me' || params[:scope] == 'authored' || params[:scope] == 'assigned-to-me' + scope = params[:scope] + scope == 'created_by_me' || scope == 'authored' || scope == 'assigned_to_me' end end |