Add last location to home page

This commit is contained in:
2023-02-25 17:04:54 +11:00
parent 62e518673a
commit 1a83557468
6 changed files with 38 additions and 5 deletions

View File

@@ -93,6 +93,15 @@ module Adamantium
query ? base.where(Sequel.ilike(:name, "%#{query}%")).to_a : base.to_a
end
def last_location
posts
.where(post_type: "checkin")
.published
.order(Sequel.desc(:published_at))
.limit(1)
.one
end
def for_rss
posts
.where(post_type: "post", location: nil)