I have a model Project
that appears in multiple controllers in an application I'm building as it appears on multiple pages. The where
clause for this isn't complicated, per se, but I feel like it is too large to be repeated on every method requiring projects with these constraints.
My question is, where, if possible, does this common call for Projects
go? In .NET
, I'd have a ProjectService
class with a method that would return all projects, and another that returned all projects that satisfied my conditions. I'm new to Rails so I'm struggling to see where this fits in?