Get an attrifutes from joins in a find method

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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs