summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMark Chao <mchao@gitlab.com>2018-05-14 10:07:53 +0800
committerMark Chao <mchao@gitlab.com>2018-05-21 09:55:30 +0800
commitd839b880a256f208ae5a0d877765bc5fcbfcd44d (patch)
treef6314a8f0ba20856e400a34a41069d630a5f3196 /app
parent40683268b2b5ad807194387d8345a30195e178c4 (diff)
downloadgitlab-ce-d839b880a256f208ae5a0d877765bc5fcbfcd44d.tar.gz
Add created_by_me and assigned_to_me scopes44799-api-naming-issue-scope
Deprecate corresponding dash versions created-by-me and assigned-to-me
Diffstat (limited to 'app')
-rw-r--r--app/finders/issuable_finder.rb9
-rw-r--r--app/finders/issues_finder.rb2
-rw-r--r--app/finders/merge_requests_finder.rb2
3 files changed, 7 insertions, 6 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
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb
index 2a27ff0e386..1787b4899cd 100644
--- a/app/finders/issues_finder.rb
+++ b/app/finders/issues_finder.rb
@@ -5,7 +5,7 @@
# Arguments:
# 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: 'open' or 'closed' or 'all'
# group_id: integer
# project_id: integer
diff --git a/app/finders/merge_requests_finder.rb b/app/finders/merge_requests_finder.rb
index 64dc1e6af0f..e2240e5e0d8 100644
--- a/app/finders/merge_requests_finder.rb
+++ b/app/finders/merge_requests_finder.rb
@@ -5,7 +5,7 @@
# Arguments:
# 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: 'open', 'closed', 'merged', or 'all'
# group_id: integer
# project_id: integer