summaryrefslogtreecommitdiff
path: root/app/finders/notes_finder.rb
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2018-10-23 09:49:45 +0000
committerPhil Hughes <me@iamphill.com>2018-10-23 09:49:45 +0000
commit86ead874e217fb1aceb2d09daf29a9a6ade0ff62 (patch)
tree16d7130d8b4ce09bff582e4506ca191253a2895c /app/finders/notes_finder.rb
parent10bb8297ebe5fc01540b20c3fd365234779b6837 (diff)
downloadgitlab-ce-86ead874e217fb1aceb2d09daf29a9a6ade0ff62.tar.gz
Resolve "Filter discussion (tab) by comments or activity in issues and merge requests"
Diffstat (limited to 'app/finders/notes_finder.rb')
-rw-r--r--app/finders/notes_finder.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/finders/notes_finder.rb b/app/finders/notes_finder.rb
index c67c2065440..817aac8b5d5 100644
--- a/app/finders/notes_finder.rb
+++ b/app/finders/notes_finder.rb
@@ -24,6 +24,8 @@ class NotesFinder
def execute
notes = init_collection
notes = since_fetch_at(notes)
+ notes = notes.with_notes_filter(@params[:notes_filter]) if notes_filter?
+
notes.fresh
end
@@ -134,4 +136,8 @@ class NotesFinder
last_fetched_at = Time.at(@params.fetch(:last_fetched_at, 0).to_i)
notes.updated_after(last_fetched_at - FETCH_OVERLAP)
end
+
+ def notes_filter?
+ @params[:notes_filter].present?
+ end
end