Fixed the query caching again since the to_sql call on an arel object exposes a bug in rails 3.2