Marten::DB::Query::RawSet(M)
Inherits Enumerable / Reference / Object
Represents a raw query set.
A raw query set allows to easily map the results of a raw SQL statement into corresponding model instances and allows to iterate over them (like a regular query set).
Constructors
Instance methods
Returns the record at the given index.
If no record can be found at the given index, then an IndexError exception is raised.
Returns the records corresponding to the passed range.
If no records match the passed range, an IndexError exception is raised.
Returns the record at the given index.
nil is returned if no record can be found at the given index.
Returns the records corresponding to the passed range.
nil is returned if no records match the passed range.
Allows to iterate over the records that are targeted by the current query set.
This method can be used to define a block that iterates over the records that are targeted by a query set:
Post.all.each do |post|
# Do something
end