Since you use Arel Core and inactive recording (which will be preferable in the future), you should understand what happens behind the engine. Depending on whether you call .each or .first, you will be returned an array from Arel :: Row (s) or one Arel :: Row (respectively)
The Arel :: Row consists of at least three parts. Attitude, title and body (tuple). These are the principles of relational algebra.
t = Arel::Table.new(:projects) ps = t.project(t[:id].as(:snark)).first
Greetings
source share