Answers for "what is the best way to store arrays in database rails"

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 "what is the best way to store arrays in database rails"

Browse Popular Code Answers by Language