📜  rails 将数组存储在数据库中 - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:46.950000             🧑  作者: Mango

代码示例1
class AddSubjectsToBook < ActiveRecord::Migration
  def change
    add_column :books, :subjects, :text, array:true, default: []
  end
end