I'm doing a rails application for a school project, and now i need store a matrix using postgresql. I was saving the values in an array, but i thought better and concluded that i need a matrix, but i don't know how to do this.
I tried in this way: - Migration:
add_column :table, :field, :text, array:true, default: []
Using this migration, the values are saving like:
[a,b,c,d,a,c,b,d,a,b,c,d,e]
I think what i need is like this:
[[a,b,c,d],[a,c,b,d],[a,b,c,d,e],[...]].
Because in this way the values are grouped.
Can someone help me?
