mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
12 lines
273 B
Ruby
12 lines
273 B
Ruby
class AddTitleToDirectories < ActiveRecord::Migration[6.0]
|
|
def change
|
|
change_table :directories do |m|
|
|
m.string :title
|
|
end
|
|
Directory.all.each do |dir|
|
|
dir.title = dir.name
|
|
dir.name = File.basename(dir.path)
|
|
dir.save!
|
|
end
|
|
end
|
|
end
|