summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Derichs <pderichs@gitlab.com>2019-07-30 20:25:49 +0200
committerPatrick Derichs <pderichs@gitlab.com>2019-08-01 10:42:42 +0200
commit0e99daae4afdb90d74c4b0bfe5cb3e482bbb422e (patch)
treef6170c10e6e6e657425c3d484eabd04d57c87bb0 /lib
parent533237a097281dbe4fb1c821d5823c4de8c8f6af (diff)
downloadgitlab-ce-0e99daae4afdb90d74c4b0bfe5cb3e482bbb422e.tar.gz
Use NotesFinder in IssuableActions module
Remove project from NotesFinder constructor Add project parameter to specs Also look for methods in private scope Fix specs to match new NotesFinder constructor
Diffstat (limited to 'lib')
-rw-r--r--lib/api/helpers/notes_helpers.rb2
-rw-r--r--lib/gitlab/project_search_results.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/helpers/notes_helpers.rb b/lib/api/helpers/notes_helpers.rb
index b03ac7deb71..7124ac0c5c3 100644
--- a/lib/api/helpers/notes_helpers.rb
+++ b/lib/api/helpers/notes_helpers.rb
@@ -76,7 +76,7 @@ module API
def find_noteable(parent_type, parent_id, noteable_type, noteable_id)
params = params_by_noteable_type_and_id(noteable_type, noteable_id)
- noteable = NotesFinder.new(user_project, current_user, params).target
+ noteable = NotesFinder.new(current_user, params.merge(project: user_project)).target
noteable = nil unless can?(current_user, noteable_read_ability_name(noteable), noteable)
noteable || not_found!(noteable_type)
end
diff --git a/lib/gitlab/project_search_results.rb b/lib/gitlab/project_search_results.rb
index 0f3b97e2317..827f4f77f36 100644
--- a/lib/gitlab/project_search_results.rb
+++ b/lib/gitlab/project_search_results.rb
@@ -108,7 +108,7 @@ module Gitlab
# rubocop: disable CodeReuse/ActiveRecord
def notes_finder(type)
- NotesFinder.new(project, @current_user, search: query, target_type: type).execute.user.order('updated_at DESC')
+ NotesFinder.new(@current_user, search: query, target_type: type, project: project).execute.user.order('updated_at DESC')
end
# rubocop: enable CodeReuse/ActiveRecord