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.1.0.rc1.1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.1.0.rc1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.0.0 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.0.0.rc3.1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.0.0.rc3 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.18.2.1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.18.2 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.17.3 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.0.0.rc2 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.18.1.1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.17.2 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-4.0.0.rc1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.18.1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.18.0 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.17.1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.16.2 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.18.0.rc2.1 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.18.0.rc2 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.17.0 db/migrate/20160404132250_remove_katello_from_notification_name.rb
katello-3.18.0.rc1 db/migrate/20160404132250_remove_katello_from_notification_name.rb