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

@@ -186,6 +186,16 @@ module Adamantium
.order(:year)
.to_a
end
def search(term:)
posts
.where(post_type: "post", location: nil)
.published
.search(term: term)
.combine(:tags)
.order(Sequel.desc(:published_at))
.to_a
end
end
end
end