Scope in rails.
Rails follow the DRY principle of software development and that is 'Don't Repeat Yourself'. Scopes are great to keep our code DRY and well organized. It's just a set of pre-defined SQL queries that we can use to write complex queries.