search for: found_categories

Displaying 1 result from an estimated 1 matches for "found_categories".

Did you mean: font_categories
2013 May 22
2
Creating nested hash from nested active record results
Hello, I''m trying to find a very abstract and "one size fits all" for converting nested active record results to nested hashes. It''s easy, to do one level deep as such: [code] results_to_hash = Hash[ found_categories.map{ |c| [c.id, c.title]}] [/code] But, when I try to add another collection to the mix, it completely borks and the results_to_hash only returns an empty hash IE: [code] results_to_hash = Hash[ found_categories.map{ |c| [c.id, c.title, c.categories]}] [/code] Ultimately, I''d like it to...