Filter week posts on homepage
This commit is contained in:
@@ -94,6 +94,18 @@ module Adamantium
|
||||
.to_a
|
||||
end
|
||||
|
||||
def week_posts(limit: nil)
|
||||
posts
|
||||
.where(post_type: "post", location: nil)
|
||||
.exclude(name: nil)
|
||||
.weekly
|
||||
.published
|
||||
.combine(:tags)
|
||||
.order(Sequel.desc(:published_at))
|
||||
.limit(limit)
|
||||
.to_a
|
||||
end
|
||||
|
||||
def post_listing(limit: nil)
|
||||
posts
|
||||
.where(post_type: "post", location: nil)
|
||||
@@ -105,6 +117,18 @@ module Adamantium
|
||||
.to_a
|
||||
end
|
||||
|
||||
def home_post_listing(limit: nil)
|
||||
posts
|
||||
.where(post_type: "post", location: nil)
|
||||
.exclude(name: nil)
|
||||
.non_weekly
|
||||
.published
|
||||
.combine(:tags)
|
||||
.order(Sequel.desc(:published_at))
|
||||
.limit(limit)
|
||||
.to_a
|
||||
end
|
||||
|
||||
def photo_listing(limit: nil)
|
||||
posts
|
||||
.where(post_type: ["post", "checkin"])
|
||||
|
Reference in New Issue
Block a user