You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Movie < ApplicationRecord
belongs_to :genre
scope :published, -> { where(published: true) }
end
class Genre < ApplicationRecord
has_many :movies
end
class MovieSearch < FortyFacets::FacetSearch
model 'Movie'
scope :published
facet :genre
end
With the following dataset:
Genre 1: { id: 1, name: 'Horror' }
Movie 1: { name: "IT", genre_id: 1, published: true }
Movie 2: { name: "IT IV", genre_id: 1, published: false }
The count for Genre 1 returns a count of 2 movies, even though Movie 2 is not published and the scope filters for published: true.
How can I make scopes to be used from facets?
Thank you.
The text was updated successfully, but these errors were encountered:
Hi, I have the following scenario:
The count for Genre 1 returns a count of 2 movies, even though Movie 2 is not published and the scope filters for
published: true
.How can I make scopes to be used from facets?
Thank you.
The text was updated successfully, but these errors were encountered: