Sha256: b0d8d7c3ca95c7fdfe19759ce602ef690b2ec27590e0263978a84b56ad88e63d

Contents?: true

Size: 737 Bytes

Versions: 177

Compression:

Stored size: 737 Bytes

Contents

class RemoveKatelloFromNotificationName < ActiveRecord::Migration[4.2]
  class FakeMailNotification < ApplicationRecord
    self.table_name = 'mail_notifications'
  end

  def up
    FakeMailNotification.all.each do |notification|
      if notification_names.keys.include?(notification.name)
        new_name = notification_names[notification.name]
        FakeMailNotification.where(:name => new_name).destroy_all
        notification.name = new_name
        notification.save!
      end
    end
  end

  private

  def notification_names
    {
      :katello_promote_errata => 'promote_errata',
      :katello_sync_errata => 'sync_errata',
      :katello_host_advisory => 'host_errata_advisory'
    }.with_indifferent_access
  end
end

Version data entries

177 entries across 177 versions & 1 rubygems

Version Path
katello-4.11.1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.11.0 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.11.0.rc2 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.11.0.rc1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.10.0 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.9.2 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.10.0.rc2 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.10.0.rc1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.8.4 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.9.1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.8.3 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.9.0 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.7.6 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.8.2 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.9.0.rc2 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.9.0.rc1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.8.1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.7.5 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.8.0 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.8.0.rc2 db/migrate/20160404132250_remove_katello_from_notification_name.rb