diff --git a/app/models/note.rb b/app/models/note.rb index 7ff6444cc9bc65de94fabdd223dccbc685df0622..01f72b95c4808e5c047430f88af32d2d4d14ea33 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -146,6 +146,10 @@ class Note < ActiveRecord::Base def cross_reference_exists?(noteable, mentioner) where(noteable_id: noteable.id, system: true, note: "_mentioned in #{mentioner.gfm_reference}_").any? end + + def search(query) + where("note like :query", query: "%#{query}%") + end end def commit_author