From 86ead874e217fb1aceb2d09daf29a9a6ade0ff62 Mon Sep 17 00:00:00 2001 From: Oswaldo Ferreira Date: Tue, 23 Oct 2018 09:49:45 +0000 Subject: Resolve "Filter discussion (tab) by comments or activity in issues and merge requests" --- app/finders/notes_finder.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/finders/notes_finder.rb') 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 -- cgit v1.2.1