add solution that works in rails console for nested hash