This project is archived and is in readonly mode.

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
- 
            
         Ernie Miller April 12th, 2010 @ 01:23 PM- no changes were found...
 
- 
            
         
- 
            
         Ernie Miller April 12th, 2010 @ 01:56 PMMinor improvement to the check to valid comparison methods (check that method matches a method in Arel::Attribute::Predications instead of just checking if the attribute responds to the method) 
- 
            
         Ernie Miller April 12th, 2010 @ 01:57 PMMinor improvement to the check to valid comparison methods (check that method matches a method in Arel::Attribute::Predications instead of just checking if the attribute responds to the method) 
- 
            
         Ernie Miller April 12th, 2010 @ 01:57 PMImprovement to the way that I was checking for valid comparison method. Check for method in Arel::Attribute::Predicates instead of just checking if the attribute responds to the method. 
- 
            
         Ernie Miller April 12th, 2010 @ 01:57 PMMinor improvement to the check to valid comparison methods (check that method matches a method in Arel::Attribute::Predications instead of just checking if the attribute responds to the method) 
- 
            
         Ernie Miller April 12th, 2010 @ 06:42 PM- Tag changed from activerelation, arel, patch, predicate_builder to activerelation, arel, feature, patch, tests
 Yikes. Sorry about the multiple posts. Lighthouse was "timing out" when I was posting earlier. 
- 
            
         
- 
            
         Ernie Miller April 15th, 2010 @ 08:32 PM- Assigned user set to Pratik
 Pratik: Thanks again for the discussion today regarding this patch. Based on our talk, I've rolled the improved hash condition handling into a gem at http://github.com/ernie/meta_where. Please feel free to check it out and give me feedback! 
- 
         Rohit Arondekar June 16th, 2010 @ 02:32 PMAny updates to this ticket? Does the plugin do what the patch intended to? Does this mean this ticket can be closed? 
- 
            
         Ernie Miller June 16th, 2010 @ 02:35 PMThe gem does everything described in the patch and more. See http://metautonomo.us/projects/metawhere for details. Yes, this ticket can be closed. :) 
- 
         Pratik June 16th, 2010 @ 02:36 PM- State changed from new to wontfix
 
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>
 Ernie Miller
      Ernie Miller
 Jeremy Kemper
      Jeremy Kemper
 Pratik
      Pratik
 Rohit Arondekar
      Rohit Arondekar