Plugins - Slice and Dice

StarAdd to favorites

Allows construction of where clauses using a hash passed in as the :conditions option.

Example:

  User.find :first, :conditions => {:name => 'Tom Ward'}
  Task.find :all, :conditions => {:priority_more_than => 50}

Tom Ward

svn://rubyforge.org//var/svn/popdog/slice_and_dice/tags/REL-0.1

  • Currently 4.2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Searching and Queries

Tags

Comments

Add a comment
Pascual Fernández 29 Sep 2006

Another improvement may be add a BETWEEN condition, i use (when :between then ["BETWEEN ? AND ?", argument.first, argument.last]) where argumemt is a range like 0..1000

Martin Zdrahal 21 Jun 2006

very nice. what's still missing in my opinion is an "in" check (when :in then ["in (?)", argument]) works nicely - that way i got a searchform with generated checkboxes to work (using <%= checkboxtag("model[field_id_in][]", a.id, false, {:alt => a.name}) %>, of course). Plus, I'm missing type checks to avoid errors that happen when - for example - comparing strings with integer fields .. or should that rather be done before doing the find?

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?