views:

10

answers:

1

Hi friends,

I am using the rails 3 for my app ,in that i need to use the proc for named scope but it is not working form me scope :donate_list,Proc.new {|nonprofit,event| where("zip IN (?) AND category_id IN (?)",nonprofit,event)}

where its getting wrong

A: 

Try with a lambda:

scope :donate_list, lambda {|nonprofit,event| where("zip IN (?) AND category_id IN (?)",nonprofit,event)}
Yannis