If you build a projection like this:
t = Arel::Table.new(:projects)
ps = t.project(t[:id].as(:snark))
How do you get the result column that’s named :snark?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since you are using the Arel Core and not active record (which will be preferred in the future) You must understand what is going on behind the engine. Depending on if you call .each or .first you will be returned an array of Arel::Row(s) or a single Arel::Row (respectively)
The Arel::Row consists of at least three parts. The relation, the header, and the body (tuple). These are the principles of relational algebra.
Cheers