can''t seem to find the right syntax for this... /script/../config/../app/controllers/placements_controller.rb:155: syntax error :conditions => [["placements.client_id = ?", params[:client_id] ] and "placements.discharge_date IS NOT NULL" ], this part works... :conditions => ["placements.client_id = ?", params[:client_id] ] this is what I want to add... "placements.discharge_date IS NOT NULL" You can see above one of the many various ways I have tried to tie them together to make a syntactically correct :conditions statement for a find... ??? You''ll be happy to know that I got if/then/elsif/end worked out by myself ;-) Craig
:conditions => ["placements.client_id = ? and placements.discharge_date IS NOT NULL", params(:client_id)] On 09/02/06, Craig White <craigwhite@azapple.com> wrote:> can''t seem to find the right syntax for this... > > /script/../config/../app/controllers/placements_controller.rb:155: > syntax error > :conditions => [["placements.client_id = ?", > params[:client_id] ] and "placements.discharge_date IS NOT NULL" ], > > this part works... > :conditions => ["placements.client_id = ?", params[:client_id] ] > > this is what I want to add... > "placements.discharge_date IS NOT NULL" > > You can see above one of the many various ways I have tried to tie them > together to make a syntactically correct :conditions statement for a > find... > > ??? > > You''ll be happy to know that I got if/then/elsif/end worked out by > myself > > ;-) > > Craig > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Yep... I simply could not intuit anything close to that but now that I see it, I realize that this is sort of a deference to sql. Thanks I have made heaps of progress Craig On Thu, 2006-02-09 at 10:41 +1100, David Mitchell wrote:> :conditions => ["placements.client_id = ? and > placements.discharge_date IS NOT NULL", params(:client_id)] > > > On 09/02/06, Craig White <craigwhite@azapple.com> wrote: > > can''t seem to find the right syntax for this... > > > > /script/../config/../app/controllers/placements_controller.rb:155: > > syntax error > > :conditions => [["placements.client_id = ?", > > params[:client_id] ] and "placements.discharge_date IS NOT NULL" ], > > > > this part works... > > :conditions => ["placements.client_id = ?", params[:client_id] ] > > > > this is what I want to add... > > "placements.discharge_date IS NOT NULL" > > > > You can see above one of the many various ways I have tried to tie them > > together to make a syntactically correct :conditions statement for a > > find... > > > > ??? > > > > You''ll be happy to know that I got if/then/elsif/end worked out by > > myself > > > > ;-) > > > > Craig > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails