class InitEduCoderLaboratory < ActiveRecord::Migration[5.2] def change ActiveRecord::Base.transaction do laboratory = Laboratory.create!(id: 1, identifier: 'www') setting = laboratory.build_laboratory_setting footer = %Q{
} config = setting.class.default_config.merge(name: 'EduCoder', footer: footer) setting.config = config setting.save! end end end