mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 21:10:54 +00:00
13 lines
273 B
Ruby
13 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
|