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

**URL:** <https://www.ruby-forum.com/t/how-to-make-something-like-in-1-3-4-in-the-conditions/172181>\
**Category:** Rails\
**Created:** [July 16, 2009, 12:26pm UTC](https://www.ruby-forum.com/t/how-to-make-something-like-in-1-3-4-in-the-conditions/172181 "2009-07-16T12:26:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thriving](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@thriving](https://www.ruby-forum.com/u/thriving)\
**Post date:** [July 16, 2009, 12:26pm UTC](https://www.ruby-forum.com/t/how-to-make-something-like-in-1-3-4-in-the-conditions/172181/1 "2009-07-16T12:26:49Z")

</div>

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 ☹

---

<div class="post-metadata">

**Author:** ![thriving](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@thriving](https://www.ruby-forum.com/u/thriving)\
**Post date:** [July 16, 2009, 12:48pm UTC](https://www.ruby-forum.com/t/how-to-make-something-like-in-1-3-4-in-the-conditions/172181/2 "2009-07-16T12:48:16Z")

</div>

named\_scope :unarchive, lambda { |project\_identifier|  
{ :conditions =\> [‘id in (?,?,?)’,3,4,5],  
}  
}

Sijo

---

<div class="post-metadata">

**Author:** ![thriving](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@thriving](https://www.ruby-forum.com/u/thriving)\
**Post date:** [July 16, 2009, 1:04pm UTC](https://www.ruby-forum.com/t/how-to-make-something-like-in-1-3-4-in-the-conditions/172181/3 "2009-07-16T13:04:16Z")

</div>

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

> google ☹  
> just use:

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

Works perfectly.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![thriving](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecae2f/32.png) [@thriving](https://www.ruby-forum.com/u/thriving)\
**Post date:** [July 17, 2009, 7:06am UTC](https://www.ruby-forum.com/t/how-to-make-something-like-in-1-3-4-in-the-conditions/172181/4 "2009-07-17T07:06:47Z")

</div>

Thank you for sijo and Peter De Berdt

Best Regard

Golf
