Sha256: dcc27a09b79d3bdaeda39b39deb9e9b77fe4626c0fd34935cc473ac84eb4af3c

Contents?: true

Size: 632 Bytes

Versions: 8

Compression:

Stored size: 632 Bytes

Contents

class RenameJobCategories < ActiveRecord::Migration
  MAP = {
    'Package Action - SSH Default' => ['Package Action', 'Packages'],
    'Puppet Run Once - SSH Default' => ['Puppet Run Once', 'Puppet'],
    'Run Command - SSH Default' => ['Run Command', 'Commands'],
    'Service Action - SSH Default' => ['Service Action', 'Services'],
  }.freeze

  def up
    MAP.each do |name, transition|
      JobTemplate.where(:name => name).update_all(:job_name => transition.last)
    end
  end

  def down
    MAP.each do |name, transition|
      JobTemplate.where(:name => name).update_all(:job_name => transition.first)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
foreman_remote_execution-1.3.7 db/migrate/20160114120200_rename_job_categories.rb
foreman_remote_execution-1.3.6 db/migrate/20160114120200_rename_job_categories.rb
foreman_remote_execution-1.4.1 db/migrate/20160114120200_rename_job_categories.rb
foreman_remote_execution-1.3.5 db/migrate/20160114120200_rename_job_categories.rb
foreman_remote_execution-1.3.4 db/migrate/20160114120200_rename_job_categories.rb
foreman_remote_execution-1.3.3 db/migrate/20160114120200_rename_job_categories.rb
foreman_remote_execution-1.3.2 db/migrate/20160114120200_rename_job_categories.rb
foreman_remote_execution-1.3.1 db/migrate/20160114120200_rename_job_categories.rb