# Find :include and :joins?

**URL:** <https://www.ruby-forum.com/t/find-include-and-joins/117045>\
**Category:** Rails\
**Created:** [October 12, 2007, 12:29pm UTC](https://www.ruby-forum.com/t/find-include-and-joins/117045 "2007-10-12T12:29:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@jamal](https://www.ruby-forum.com/u/jamal)\
**Post date:** [October 12, 2007, 12:29pm UTC](https://www.ruby-forum.com/t/find-include-and-joins/117045/1 "2007-10-12T12:29:20Z")

</div>

Hello there,

I facing some problems with :include, I want to be able to use the  
:select method or I will end up using the :joins ☹

JOINS =\>  
find(:first, :select =\> “messages.\*, users.id as nid, users.nickname”,  
:conditions =\> [“messages.id = ? AND messages.user\_from\_id = ?”,  
id, user\_id],  
:joins =\> “LEFT JOIN users ON users.id = messages.user\_from\_id”)

INCLUDE =\>  
find(:first, :conditions =\> [“messages.id = ? AND messages.user\_from\_id  
= ? AND messages.deleted\_from\_id = ?”, id, user\_id, false],  
:include =\> [:to])

The join let me get the nickname by typing  
@message.nickname (Baad)

The include let me get the nickname by typing  
@message.to.nickname (This is the way I prefer)

So how I can use the :include and still NOT receive all the information  
from the :to table? Because I want to be able to use the  
@message.to.nickname instead of @message.nickname

//Thanks for all the help 😃
