How to make something like IN (1,3,4) in the :conditions

named_scope :unarchive, lambda { |project_identifier|
{ :conditions => {:project_id => project_identifier,:archive => false},
order => :name}
}

Here is the code

within condition i want to make something like :id=>“IN (3,4,5)” but i
don’t know how to write it in rails , i don’t know what to search in
google :frowning:

named_scope :unarchive, lambda { |project_identifier|
{ :conditions => [‘id in (?,?,?)’,3,4,5],
}
}

Sijo

On 16 Jul 2009, at 12:26, Thriving K. wrote:

google :frowning:
just use:

:conditions => {:id => [1,2,4]}

Works perfectly.

Best regards

Peter De Berdt

Thank you for sijo and Peter De Berdt

Best Regard

Golf