Sha256: 70aaf1e13a38f8049a1bdf9d7bcd22fddeae6f908765a696dcde95e9fdaef335

Contents?: true

Size: 1.34 KB

Versions: 30

Compression:

Stored size: 1.34 KB

Contents

# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# !!! PLEASE KEEP THIS SCRIPT IDEMPOTENT !!!
#
User.as(::User.anonymous_api_admin.login) do
  # The notification names are used as humanized labels. These need to be
  # translated as well as the description
  N_('Host errata advisory')
  N_('Sync errata')
  N_('Promote errata')

  # Mail Notifications
  notifications = [
    {:name => :host_errata_advisory,
     :description => N_('A summary of available and applicable errata for your hosts'),
     :mailer => 'Katello::ErrataMailer',
     :method => 'host_errata',
     :subscription_type => 'report'
    },

    {:name => :sync_errata,
     :description => N_('A summary of new errata after a repository is synchronized'),
     :mailer => 'Katello::ErrataMailer',
     :method => 'sync_errata',
     :subscription_type => 'alert'
    },

    {:name => :promote_errata,
     :description => N_('A post-promotion summary of hosts with installable errata'),
     :mailer => 'Katello::ErrataMailer',
     :method => 'promote_errata',
     :subscription_type => 'alert'
    }
  ]

  notifications.each do |notification|
    ::MailNotification.where(name: notification[:name]).first_or_create!(notification)
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
katello-3.15.3.1 db/seeds.d/106-mail_notifications.rb
katello-3.15.3 db/seeds.d/106-mail_notifications.rb
katello-3.15.2 db/seeds.d/106-mail_notifications.rb
katello-3.15.1.1 db/seeds.d/106-mail_notifications.rb
katello-3.15.1 db/seeds.d/106-mail_notifications.rb
katello-3.15.0.1 db/seeds.d/106-mail_notifications.rb
katello-3.15.0 db/seeds.d/106-mail_notifications.rb
katello-3.15.0.rc2 db/seeds.d/106-mail_notifications.rb
katello-3.15.0.rc1.3 db/seeds.d/106-mail_notifications.rb
katello-3.15.0.rc1.2 db/seeds.d/106-mail_notifications.rb
katello-3.15.0.rc1.1 db/seeds.d/106-mail_notifications.rb
katello-3.15.0.rc1 db/seeds.d/106-mail_notifications.rb
katello-3.14.1 db/seeds.d/106-mail_notifications.rb
katello-3.13.4 db/seeds.d/106-mail_notifications.rb
katello-3.14.0 db/seeds.d/106-mail_notifications.rb
katello-3.13.3 db/seeds.d/106-mail_notifications.rb
katello-3.14.0.rc2 db/seeds.d/106-mail_notifications.rb
katello-3.13.2 db/seeds.d/106-mail_notifications.rb
katello-3.14.0.rc1 db/seeds.d/106-mail_notifications.rb
katello-3.13.1 db/seeds.d/106-mail_notifications.rb