# Help with multiple one to many relationship

**URL:** <https://www.ruby-forum.com/t/help-with-multiple-one-to-many-relationship/145545>\
**Category:** Rails\
**Created:** [August 11, 2008, 12:49pm UTC](https://www.ruby-forum.com/t/help-with-multiple-one-to-many-relationship/145545 "2008-08-11T12:49:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kanekcwu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7c8e57/32.png) [@kanekcwu](https://www.ruby-forum.com/u/kanekcwu)\
**Post date:** [August 11, 2008, 12:49pm UTC](https://www.ruby-forum.com/t/help-with-multiple-one-to-many-relationship/145545/1 "2008-08-11T12:49:26Z")

</div>

Hi I have created three models

class Winery  
has many :brands  
end

class brand  
has many :wines  
belongs\_to winery  
end

class wines  
belongs\_to brand  
end

Now I am trying to do a find method that references from wines to  
winery. How do I do that. I tried using Wines.find(:all, :include  
[:brand,:winery]) and it doesn’t work. Is there any simpler way other  
than using mysql? Thank you

---

<div class="post-metadata">

**Author:** ![kanekcwu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7c8e57/32.png) [@kanekcwu](https://www.ruby-forum.com/u/kanekcwu)\
**Post date:** [August 11, 2008, 1:11pm UTC](https://www.ruby-forum.com/t/help-with-multiple-one-to-many-relationship/145545/2 "2008-08-11T13:11:57Z")

</div>

> class wines  
> belongs\_to brand  
> belongs\_to :winery, :through =\> :brand  
> end

Wines.find(:all, :include =\> [:brand =\> [:winery]])

this should do (not 100% of the details for the include, but  
something on that line)
