EZ Where plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install svn://rubyforge.org/var/svn/ez-where
ez_where maps ruby operators to sql ops. Like this:
articles = Article.find_where(:all, :include => :author) do |article, author| article.title =~ "%Foo Title%" author.any do name == 'Ezra' name == 'Fab' end end
will result in
articles = Article.find(:all, :conditions => ["article.title LIKE ? AND (authors.name = ? OR authors.name = ?)", "%Foo Title%", "Ezra", "Fab"])
There are many more features to this plugin. See the extensive test cases in the plugin for all available options.
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: maxim_kulkin, 8 months ago

