Updates notes filtering to search description too
Updates notes filtering to search for query text in both note comments and note's description.
This commit is contained in:
parent
663459d1c1
commit
4133936c63
1 changed files with 3 additions and 1 deletions
|
@ -263,7 +263,9 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
# Add any text filter
|
# Add any text filter
|
||||||
@notes = @notes.joins(:comments).where("to_tsvector('english', note_comments.body) @@ plainto_tsquery('english', ?)", params[:q]) if params[:q]
|
if params[:q]
|
||||||
|
@notes = @notes.joins(:comments).where("to_tsvector('english', note_comments.body) @@ plainto_tsquery('english', ?) OR to_tsvector('english', notes.description) @@ plainto_tsquery('english', ?)", params[:q], params[:q])
|
||||||
|
end
|
||||||
|
|
||||||
# Add any date filter
|
# Add any date filter
|
||||||
if params[:from]
|
if params[:from]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue