Each and Fetch
Last updated
Last updated
Collection inherits from therefore it allows all the methods defined by the module. When calling enumeration via each
or map
or any other methods defined in Enumerable(T)
, the collection is resolved and SQL request is triggered.
Return the list of models returned by the request:
Fetch stands for iterating through hash instead of model. While offering less features (as we do not connect a model to the data), it offers best performances, as no extra-allocations are made: