# Model.find with two associations

**URL:** <https://www.ruby-forum.com/t/model-find-with-two-associations/110973>\
**Category:** Rails\
**Created:** [August 1, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/model-find-with-two-associations/110973 "2007-08-01T17:01:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Wallace](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/46a35a/32.png) [@Ryan\_Wallace](https://www.ruby-forum.com/u/Ryan_Wallace)\
**Post date:** [August 1, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/model-find-with-two-associations/110973/1 "2007-08-01T17:01:42Z")

</div>

Hi,

I would like to know the rails way to do the following:

If I have an Item model which has\_many :tags, :through =\> item\_tags  
how can I find all items which are tagged with both a “ruby” and  
“rails” tag. Also I would like to find all items tagged with either  
“ruby” or “rails”. What is the best way to do these queries?

Thanks,  
Ryan
