This project is archived and is in readonly mode.

#4368 ✓wontfix
Ernie Miller

Patch: Access to more Arel predicate types from where condition hash

Reported by Ernie Miller | April 12th, 2010 @ 03:18 AM

Similar to 'table.column' => 'value', this patch enables 'column#method' => 'value'.

For instance, Article.where('title#matches' => 'Hello%') generates SQL like:

SELECT "articles".* FROM "articles" WHERE ("articles"."title" LIKE 'Hello%')

This patch also handles the "any" and "all" predicates (simplified or/and syntax) which don't exist in the current Arel, but do in my Arel fork at http://github.com/ernie/arel. If anyone's looking here, I'd really appreciate some eyes on that fork as well for some possible additions to rails/arel. :)

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages