Sha256: 5b9ab253383079cf67274582e2bbe197649f3cd80eecf8d5345bffb2424b3603
Contents?: true
Size: 1 KB
Versions: 7
Compression:
Stored size: 1 KB
Contents
# -*- encoding : utf-8 -*- class RenamingForMenu < Cardio::Migration::Core def up renames = { "*content" => "*structure", "*edit help" => "*help", "*links" => "*links to", "*inclusions" => "*includes", "*linkers" => "*linked to by", "*includers" => "*included by", "*plus cards" => "*children", "*plus parts" => "*mates", "*editing" => "*edited" } renames.each do |oldname, newname| puts "updating: #{oldname}" c = Card[oldname] c.update_referers = true c.name = newname c.save! end codenames = %w[ by_name by_update by_create refers_to links_to includes referred_to_by linked_to_by included_by children mates editors discussion created edited ] codenames.each do |codename| name = codename =~ /^by|disc/ ? codename : "*#{codename}" c = Card[name] c.codename = codename c.save! end end end
Version data entries
7 entries across 7 versions & 1 rubygems