I need help. I'm optimizing Ruby project. There are a lot of single queries so I read them at once with array of ids, example:
projects = Project.find_by_id(array_of_ids)
And I got significant improvement in speed. But the problem is when I want to search in such result, how can I work with such result?
p = projects .find{ |project| project.id==pr.id } # doesn't work
Can I convert 'projects' to array or use active-record methods further on it? Can I get two-dimensional array of 'projects' grouped by some parameter using Activerecord?