# Problems when trying to use include

**URL:** <https://www.ruby-forum.com/t/problems-when-trying-to-use-include/145233>\
**Category:** Ruby\
**Created:** [August 7, 2008, 1:22am UTC](https://www.ruby-forum.com/t/problems-when-trying-to-use-include/145233 "2008-08-07T01:22:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![staypufd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@staypufd](https://www.ruby-forum.com/u/staypufd)\
**Post date:** [August 7, 2008, 1:22am UTC](https://www.ruby-forum.com/t/problems-when-trying-to-use-include/145233/1 "2008-08-07T01:22:57Z")

</div>

I’m trying to access data from the skins table (see below) through a  
nested include  
with no luck. The association is all through imageasset but I do not  
know how to figure it out. Any help is highly appreciated.

######the controller code#######  
@furnii\_from\_furnii = Furni.find :all, :include =\> [{:raider =\>  
:imageasset}, :skin ] , :conditions =\>  
“”+Furni.conditions\_by\_like(@search)+" OR "  
+Raider.conditions\_by\_like(@search) + “OR”  
+Skin.conditions\_by\_like(@search) + “”

#######I have 4 models set up this way (did only include the necessary  
code )#######  
class Furni \< ActiveRecord::Base  
belongs\_to :imageasset  
belongs\_to :raider, :foreign\_key =\> “original\_raider\_id”  
end  
class Raider \< ActiveRecord::Base  
belongs\_to :imageasset  
end  
class Skin \< ActiveRecord::Base  
belongs\_to :imageasset  
end

class Imageasset

## nothing

end

---

<div class="post-metadata">

**Author:** ![staypufd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecd19e/32.png) [@staypufd](https://www.ruby-forum.com/u/staypufd)\
**Post date:** [August 7, 2008, 4:28pm UTC](https://www.ruby-forum.com/t/problems-when-trying-to-use-include/145233/2 "2008-08-07T16:28:32Z")

</div>

You should ask about it on Rails:)

[http://www.ruby-forum.com/forum/3](http://www.ruby-forum.com/forum/3)
