# Named\_scopes in deep relations

**URL:** <https://www.ruby-forum.com/t/named-scopes-in-deep-relations/188201>\
**Category:** Rails\
**Created:** [May 7, 2010, 3:15pm UTC](https://www.ruby-forum.com/t/named-scopes-in-deep-relations/188201 "2010-05-07T15:15:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7ab992/32.png) [@jeb](https://www.ruby-forum.com/u/jeb)\
**Post date:** [May 7, 2010, 3:15pm UTC](https://www.ruby-forum.com/t/named-scopes-in-deep-relations/188201/1 "2010-05-07T15:15:16Z")

</div>

Hi,

I try to use a named scope for using searchlogic, but I don’t  
understand how to do in this case:

I want to find activities by area\_id  
Each activity HAS MANY occations  
Each occation has one location  
A column in locations is called area\_id

This beats me, hope anyone can help!

🙂 j
