you need serialize column in model
Class Message < ActiveRecord::Base serialize :is_deleted, Array end
for an extra note, if you want a column to be used to store an array, then it should be a column_type or text string
Message.all.each { |m| m.update_attribute(:is_deleted, m.is_deleted.push(2)) }
source share