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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Reginald James
2008-Dec-11 23:24 UTC
Re: Get an attrifutes from joins in a find method
Luca Roma 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 worksTry example[0][:hello_word] -- Rails Wheels - Find Plugins, List & Sell Plugins - http://railswheels.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---