Search posts

This commit is contained in:
2023-11-24 22:37:31 +11:00
parent bb911e4951
commit bed50e9b7e
7 changed files with 130 additions and 11 deletions

View File

@@ -35,6 +35,13 @@ module Adamantium
where(self[:published_at] >= start_date)
.where(self[:published_at] <= end_date)
end
def search(term:)
ref = dataset
.full_text_search([:content], [term])
.select(:id)
where(id: ref)
end
end
end
end