标签: ruby-on-rails ruby-on-rails-4
如何在数据库中保存此数据结构?
{ amount => [{year => total_cost}], amount => [{year => total_cost}], amount => [{year => total_cost}] }
答案 0 :(得分:1)
查看PostgreSQL's hstore功能。它是为这种情况而建立的。