Add statuses

This commit is contained in:
2023-02-27 21:02:38 +11:00
parent 23d03d2be1
commit f1c3263922
10 changed files with 81 additions and 2 deletions

View File

@@ -55,6 +55,7 @@ module Adamantium
def post_listing(limit: nil)
posts
.where(post_type: "post", location: nil)
.exclude(name: nil)
.published
.combine(:tags)
.order(Sequel.desc(:published_at))
@@ -93,6 +94,25 @@ module Adamantium
query ? base.where(Sequel.ilike(:name, "%#{query}%")).to_a : base.to_a
end
def statuses_listing(limit: nil)
posts
.where(post_type: "post", name: nil)
.published
.combine(:tags)
.order(Sequel.desc(:published_at))
.limit(limit)
.to_a
end
def latest_status
posts
.where(name: nil)
.published
.order(Sequel.desc(:published_at))
.limit(1)
.one
end
def last_location
posts
.where(post_type: "checkin")