They are also a great place to define scopes, or what Hanami calls datasets.
Scopes are not datasets, scopes are what help you build datasets. The dataset is the current state of the query before it is executed. So every Relation has a default dataset, and every scope call you chain builds on the previous dataset state and returns a new one.
1 Like