# Get an attrifutes from joins in a find method

**URL:** <https://www.ruby-forum.com/t/get-an-attrifutes-from-joins-in-a-find-method/155432>\
**Category:** Rails\
**Created:** [December 11, 2008, 6:54pm UTC](https://www.ruby-forum.com/t/get-an-attrifutes-from-joins-in-a-find-method/155432 "2008-12-11T18:54:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stratboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/838e76/32.png) [@stratboy](https://www.ruby-forum.com/u/stratboy)\
**Post date:** [December 11, 2008, 6:54pm UTC](https://www.ruby-forum.com/t/get-an-attrifutes-from-joins-in-a-find-method/155432/1 "2008-12-11T18:54:43Z")

</div>

I have wrote an example:

example=Example.find(:all,:joins=\>"(select id,“hello” as hello\_name from  
examples2) as examples3 where examples3.id=examples.id")

I want get the attribute hello\_name that not exits in db.  
example[0].hello\_word not works  
example[0].example3.hello\_name not works  
how can i do?  
thanks

---

<div class="post-metadata">

**Author:** ![stratboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/838e76/32.png) [@stratboy](https://www.ruby-forum.com/u/stratboy)\
**Post date:** [December 12, 2008, 12:25am UTC](https://www.ruby-forum.com/t/get-an-attrifutes-from-joins-in-a-find-method/155432/2 "2008-12-12T00:25:14Z")

</div>

Luca R. wrote:

> I have wrote an example:
> 
> example=Example.find(:all,:joins=\>“(select id,“hello” as hello\_name from  
> examples2) as examples3 where examples3.id=examples.id”)
> 
> I want get the attribute hello\_name that not exits in db.  
> example[0].hello\_word not works  
> example[0].example3.hello\_name not works

Try example[0][:hello\_word]

–  
Rails Wheels - Find Plugins, List & Sell Plugins -  
[http://railswheels.com](http://railswheels.com)
