Sha256: 17b29fe9f2e4e2a34e17e63c4e6cdbb63af3069cba98ba63c99ce01e967d1700
Contents?: true
Size: 427 Bytes
Versions: 6
Compression:
Stored size: 427 Bytes
Contents
class AddNameToSections < ActiveRecord::Migration[5.1] def change add_column :sections, :name, :string, null: false, limit: 64 begin Dhatu::Section.all.each do |section| section.name = section.code.titleize.gsub("_", " ") if section.code section.save end rescue puts "" puts "" puts "" puts "ERROR in AddNameToSections".red puts "" puts "" puts "" end end end
Version data entries
6 entries across 6 versions & 1 rubygems