camertron/arel-helpers — pull request #3 by hasghari (2014-05-10 19:02:11+00:00)
Title: terminal methods should be delegated to query

Currently the `QueryBuilder` module does not delegate terminal methods to the `ActiveRecord::Relation` object which results in less efficient queries.

I wanted to write specs to ensure the following sql is generated:

```ruby
TestQueryBuilder.new.count
# => SELECT COUNT(*) FROM "posts"
```

However, `count` being a terminal method, we cannot append `to_sql` to inspect the statement.