Add mising repos post-refactor

This commit is contained in:
2024-02-23 08:31:30 +11:00
parent 6978a3dfc6
commit c27ad28697
2 changed files with 45 additions and 0 deletions

19
app/repos/post_repo.rb Normal file
View File

@@ -0,0 +1,19 @@
module Adamantium
module Repos
class PostRepo < Adamantium::Repo[:posts]
Sequel.extension :pg_json
Sequel.extension :pg_json_ops
def for_reminders(limit:)
posts
.where(post_type: "bookmark", is_read: false)
.limit(limit)
.published
.combine(:tags)
.order(Sequel.desc(:published_at))
.to_a
end
end
end
end