Sha256: 72bb396ea560fd4475b2d20dcc1f8c40c6ce931af33182df3c2c3c2505c34118

Contents?: true

Size: 385 Bytes

Versions: 16

Compression:

Stored size: 385 Bytes

Contents

class RenameConfigDefaultPartsKey < ActiveRecord::Migration[5.1]

  def self.up
    rename_config_key 'default.parts', 'defaults.page.parts'
  end

  def self.down
    rename_config_key 'defaults.page.parts', 'default.parts'
  end

  def self.rename_config_key(from, to)
    return unless setting = TrustyCms::Config.find_by_key(from)
    setting.key = to
    setting.save!
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
trusty-cms-3.3.2 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.3.1 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.2.1 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.3.0 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.2.0 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.1.11 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.1.10 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.1.9 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.1.8 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.1.7 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.1.6 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.1.5 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.1.3 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.1.2 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.1.1 db/migrate/014_rename_config_default_parts_key.rb
trusty-cms-3.1.0 db/migrate/014_rename_config_default_parts_key.rb