It's easy, to do one level deep as such: results_to_hash = Hash[ ... Creating nested hash from nested active record results · Ruby.
確定! 回上一頁