22 Mar '13, 6pm

@mpak999 я бы сделал отдельной таблицой 1-к-1, запрос был бы джоин с условием. В документации есть что-то подобное.

But this approach becomes increasingly impractical as the table size increases, since User.all.each instructs Active Record to fetch the entire table in a single pass, build a model object per row, and then keep the entire array of model objects in memory. Indeed, if we have a large number of records, the entire collection may exceed the amount of memory available.

Full article: http://guides.rubyonrails.org/active_record_querying.html...

Tweets

A Simplified Query Interface for Relationships ...

rubyflow.com 11 Mar '13, 10pm

A Simplified Query Interface for Relationships in Active Record 4 Posted by beerlington on March 11, 2013 — 0 comments I w...