Skip to content
Snippets Groups Projects
Unverified Commit 7c05f665 authored by Sébastien Gaya's avatar Sébastien Gaya Committed by GitHub
Browse files

Merge pull request #1556 from noesya/fix-categories-scope

fix scope categories
parents c24d4252 ca97099a
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ class Communication::Website::Post < ApplicationRecord
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 }
scope :for_category, -> (category_id) { joins(:categories).where(communication_website_post_categories: { id: category_id }).distinct }
scope :for_pinned, -> (pinned) { where(pinned: pinned == 'true') }
scope :for_search_term, -> (term) {
where("
......
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