Answers for "rails store array in database"

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

Browse Popular Code Answers by Language