Plugins - Condition Builder

StarAdd to favorites

I use this directly in my ActiveRecord queries, like this:

Book.find(:all,
  :include => {:content_pointer => :invitees},
  :conditions => Condition.block { |c|
    c.and "invitees.user_id", self.id
    c.and "content_pointers.created_by_id", self.id
    c.and "content_pointers.company_id", company.id if company
  })

Duane Johnson

http://blog.inquirylabs.com/2007/01/04/condition-builder-10-released/

http://inquirylabs.com/downloads/condition-builder-1.0.tgz

Rails' (MIT)

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

Searching and Queries

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?