On 5 June 2011 07:45, skt <[email protected]> wrote: > > > On Jun 4, 12:57 am, Colin Law <[email protected]> wrote: >> On 3 June 2011 17:49, skt <[email protected]> wrote: >> >> > Hello, >> >> > I have a bunch of arrays containing records retrieved from the >> > database in separate queries. That can't be changed - I have deal with >> > the different arrays of these records. Each of these records contains, >> > amongst other data fields, two ids - a user_id and an address_id. >> >> When you say you have arrays are these actual arrays or are they the >> result of ActiveRecord find queries, which are like arrays but are not >> actually arrays? > > These are result of ActiveRecord queries. I thought they were arrays > of database record objects - could you please help me understand how > they are different from normal arrays?
The result of Model.where( some_condition ), for example, is an ActiveRecord::Relation object rather than an array. You can for example apply further .where operations on it to refine the search further. Colin -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

