diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-03-07 23:45:50 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-03-13 08:27:51 +0100 |
commit | dcec4c531f3268a7ae681bb7cc5d5b7217b4b33a (patch) | |
tree | 81fb92469d04916f581b417dc5606996aad05ed4 | |
parent | b9aa6c3583578d3ddd971139b91fb6226a49102a (diff) | |
download | gitlab-ce-dcec4c531f3268a7ae681bb7cc5d5b7217b4b33a.tar.gz |
Finding discussions in NotesFinder is no longer required.
Since the MergeRequest is now a required param for resolving discussions
-rw-r--r-- | app/finders/notes_finder.rb | 6 | ||||
-rw-r--r-- | spec/finders/notes_finder_spec.rb | 11 |
2 files changed, 0 insertions, 17 deletions
diff --git a/app/finders/notes_finder.rb b/app/finders/notes_finder.rb index 98c66dfa021..6630c6384f2 100644 --- a/app/finders/notes_finder.rb +++ b/app/finders/notes_finder.rb @@ -11,7 +11,6 @@ class NotesFinder # target_type: string # target_id: integer # last_fetched_at: time - # discussion_id: string # search: string # def initialize(project, current_user, params = {}) @@ -23,7 +22,6 @@ class NotesFinder def execute @notes = since_fetch_at(@params[:last_fetched_at]) if @params[:last_fetched_at] - @notes = for_discussion(@params[:discussion_id]) if @params[:discussion_id] @notes end @@ -102,8 +100,4 @@ class NotesFinder @notes.where('updated_at > ?', last_fetched_at - FETCH_OVERLAP).fresh end - - def for_discussion(discussion_id) - @notes.where(discussion_id: discussion_id) - end end diff --git a/spec/finders/notes_finder_spec.rb b/spec/finders/notes_finder_spec.rb index 2c72f7839a6..77a04507be1 100644 --- a/spec/finders/notes_finder_spec.rb +++ b/spec/finders/notes_finder_spec.rb @@ -41,17 +41,6 @@ describe NotesFinder do expect(notes.count).to eq(0) end - context 'for a certain discussion' do - let!(:note_in_a_commit_discussion) { create(:note_on_commit, project: project) } - let!(:other_note) { create(:note_on_merge_request, project: project) } - - it 'finds the only the notes for a certain discussion id' do - notes = described_class.new(project, user, discussion_id: note_in_a_commit_discussion.discussion_id).execute - - expect(notes).to contain_exactly(note_in_a_commit_discussion) - end - end - context 'on restricted projects' do let(:project) do create(:empty_project, |