我尝试使用arraycolumn 部署到 Heroku。但是会出现这个错误。我可以使用什么方法而不是serialize更好?
ActiveRecord::AttributeMethods::Serialization::ColumnNotSerializableError (Column `days` of type ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Array does not support `serialize` feature.
Usually it means that you are trying to use `serialize`
on a column that already implements serialization natively.
// 迁移文件
class AddDaysToSchedule < ActiveRecord::Migration[5.2]
def change
add_column :event_types, :days, :text, array: true
end
end
// 调度模型
class Schedule < ApplicationRecord
serialize :days, Array
请让我知道你知道如何堆栈溢出。