Assuming you have a Postgres table called maps
, created by the following migration:
create_table :maps do |t|
t.string :name
t.string :grid, array: true, length: 3, default: Array.new(3,nil)
end
And you have the following ActiveRecord class with a function that modifies the grid