Class: Setting::Slack

Inherits:
Setting
  • Object
show all
Defined in:
app/models/setting/slack.rb

Constant Summary collapse

BLANK_HOOK =
'blank_hook'

Class Method Summary collapse

Class Method Details

.load_defaultsObject



4
5
6
7
8
9
10
11
12
13
14
# File 'app/models/setting/slack.rb', line 4

def self.load_defaults
  Setting.transaction do
    [
      self.set('slack_webhook', N_("Slack.com webhook URL"), BLANK_HOOK),
      self.set('slack_channel', N_("Slack channel (starts with #)"), "#dev_ops"),
      self.set('slack_username', N_("User name"), "foreman"),
      self.set('notify_slack_host_built', N_("Notify Slack when host is build"), true, N_("Notify Slack Host build")),
      self.set('notify_slack_puppet_error', N_("Notify Slack on puppet error"), true, N_("Notify Slack Puppet error")),
    ].compact.each { |s| self.create s.update(:category => "Setting::Slack")}
  end
end