Create query scopes for complex where()s

Create query scopes for complex where()s

Rather than writing complex where() clauses, create query scopes with expressive names.

This will make your e.g. controllers have to know less about the database structure and your code will be cleaner.

We're writing a book, you can get it for free here.