Show bookmarks on post page
This commit is contained in:
@@ -10,13 +10,6 @@ module Main
|
||||
end
|
||||
|
||||
def from_the_archives(start_date:, end_date:)
|
||||
# SELECT * FROM posts
|
||||
# WHERE EXTRACT(month FROM "published_at") >= 2
|
||||
# WHERE EXTRACT(month FROM "published_at") <= 2+
|
||||
# AND EXTRACT(day FROM "published_at") > 20
|
||||
# AND EXTRACT(day FROM "published_at") < 27
|
||||
# AND post_type = 'post';
|
||||
|
||||
movies
|
||||
.where { Sequel.extract(:year, :watched_at) >= start_date.year }
|
||||
.where { Sequel.extract(:year, :watched_at) <= start_date.year }
|
||||
|
@@ -154,6 +154,13 @@ module Main
|
||||
.to_a
|
||||
end
|
||||
|
||||
def bookmarks_for_week(date:)
|
||||
posts
|
||||
.where(post_type: "bookmark")
|
||||
.where(published_at: TimeMath.day.advance(date, -7)...TimeMath.day.floor(date))
|
||||
.to_a
|
||||
end
|
||||
|
||||
def all_posts
|
||||
posts
|
||||
.where(post_type: ["post", "code", "bookmark"])
|
||||
|
Reference in New Issue
Block a user