I read all about this and how there are transactional issues in updating an array column but mine wont even create.
class Recipe < ActiveRecord::Base
serialize :steps
...
end
Migration
add_column :recipes, :steps, :text, array:true, default: []
Output
$ r = Recipe.create(steps: [1,2,3])
> #<Recipe:0x007fe38ae68870 id: 27, ..., steps: [], ingredients: []>
Also played around with this method with no luck:
def add_steps(steps)
steps_will_change!
update_attributes steps: self.steps + steps
end
reload!in the console?serializewith PostgreSQL array columns.serializewith array columns. It's one or the other. Thanks