hoodwink.d enhanced
RSS
2.0
XHTML
1.0

RedHanded

Tuesday

2006.01.31

Ezra's Where Plugin is Out #

by why in inspect

Okay, well, KLAAABOOM, more Ruby. For spelling out queries. Lotsa operator mischief. As always, don’t take this too seriously, if you are prone to it. If you are not, then this calls for some bubbly.

 articles = Article.ez_find(:all, :include => :author) do |article, author|
   article.title =~ "%Foo Title%" 
   author.any do
     name  'Ezra'
     name  ‘Fab’
   end 
 end

To install:

 script/plugin install http://opensvn.csie.org/ezra/rails/plugins/dev/ez_where/

And, if you go deeper, there is a whole explanation.