Best place in project to define query scope if there is no model?

Posted 1 month ago by djolefjc

So, I'm working on upgrading an old project to a newer version. The thing is, the project has a certain search filter if I might call it that way. An old collague of mine who built that app made that search filter with nested if statements and it works perfectly but the code is a nightmare. After looking online I found that the most neat way to make that search filter is with a query scope, which is usually defined in a model but the thing is I don't have a model for that search filter.

So my question is, would it be bad if I defined it in a controller?

Please sign in or create an account to participate in this conversation.