Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Possible to use sifters in other sifters? #399

Open
bostrom opened this issue Sep 9, 2015 · 0 comments
Open

Possible to use sifters in other sifters? #399

bostrom opened this issue Sep 9, 2015 · 0 comments

Comments

@bostrom
Copy link

bostrom commented Sep 9, 2015

Sifters seem to be great for a single model only. I'm trying to use one model's sifters in another model, but I can't seem to know how to do it, if possible.

According to the docs, sifters are used in where conditions like so

Person.joins(:articles).
       where{
         {articles => sift(:title_or_body_contains, 'awesome')}
       }

How can I include that article sifter in a sifter for the Person model? Lets say, for example, that I want to create a sifter for Persons whose first name is included in the article's title. Is that possible or am I thinking backwards here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant