From: Junkone Date: 2007-11-26T04:05:01+09:00 Subject: Re: active record quetion. On Nov 25, 12:45 pm, Rich Vázquez wrote: > t is an Array (see this by typing t.class) > So, t.id is going to return a value related to the Array class as opposed to > the contents. > > t[0].id t[1].id etc would return what you are expecting > > On Nov 25, 2007 10:29 AM, Junkone wrote: > > > > > > > here is my issue. i want to get the id of of the record extracted > > here. it however gives me 37832400 > > instead of 9. i am not sure why. > > > >> t=Trade.find_by_sql("select * from trades where tradestatus='O' and > > symbol_al > > ias='USD.CHF-IDEALPRO-CASH'") > > => [#"O", > > "tradestrategy"=>nil, "sy > > mbol_alias"=>"USD.CHF-IDEALPRO-CASH", "tradeinterval"=>"5MINUTE", > > "getpictures"= > > >nil, "tradename"=>nil, "id"=>"9", "grossrevenue"=>nil, > > "tradecomments"=>nil, "t > > radedirection"=>"Long"}>] > > >> t.id > > (irb):8: warning: Object#id will be deprecated; use Object#object_id > > => 37832400 > > -- > -- > Rich Vázquez, CISSP, CISA- Hide quoted text - > > - Show quoted text - thanks for the pointer. my bad.