Add search method to Note class
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
9a4ef7e7eb
commit
5d9a5c02d8
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue