heroku/databasedotcom — pull request #81 by campbell (2012-04-10 00:41:54+00:00)
Title: ActiveRecord AREL style queries

Currently it is not possible to change any SOQL query parameters except the WHERE clause. To fix this, I implemented AREL-like queries so now you can do this:

Account.soql_query.where("value > 10").order_by('name DESC').limit(10)
Account.soql_query.selects("name, value, date").where("value > 10")

The chained functions above return a Query object that is lazy-loaded when the #all, #each, #first or #last methods are called.

I have also modified the Sobject methods that currently use self.client.query to use the new AREL style (all existing tests pass).