Skip to content
Snippets Groups Projects
Unverified Commit 49f42cfa authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

fix pinned order

parent 9329da6b
No related merge requests found
......@@ -80,7 +80,7 @@ class Communication::Website::Post < ApplicationRecord
DATE(communication_website_posts.published_at) > now()
")
}
scope :ordered, -> { order(published_at: :desc, created_at: :desc) }
scope :ordered, -> { order(pinned: :desc, published_at: :desc, created_at: :desc) }
scope :recent, -> { order(published_at: :desc).limit(5) }
scope :for_author, -> (author_id) { where(author_id: author_id) }
scope :for_category, -> (category_id) { joins(:categories).where(communication_website_categories: { id: category_id }).distinct }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment