ModelName::Collection
. This Collection
object offers a way to query the database and perform operations on large groups of model.Collection
, you can simply call the method query
over the model class:to_a
over the Collection will fetch all the models from the database to your crystal code:each
or to_a
for example.Collection#dup
to duplicate the current state of the collection:SQL::SelectBuilder
object described in Low-level SQL chapter.