1

how do I save this data structure in the database?

{
  amount => [{year => total_cost}],
  amount => [{year => total_cost}],
  amount => [{year => total_cost}]
}
Ismail
  • 41
  • 5
  • 1
    look into activerecord serialize http://stackoverflow.com/questions/6694432/using-rails-serialize-to-save-hash-to-database – Joel Mar 03 '15 at 21:16

1 Answers1

1

Look into PostgreSQL's hstore feature. It is built for this very situation.

aspencer8111
  • 786
  • 4
  • 9