Answers for "how to store an array in rails db"

0

rails store array in database

class AddSubjectsToBook < ActiveRecord::Migration
  def change
    add_column :books, :subjects, :text, array:true, default: []
  end
end
Posted by: Guest on January-28-2021

Code answers related to "how to store an array in rails db"

Browse Popular Code Answers by Language