Class: Setting::General

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

Constant Summary

Constants inherited from Setting

BLANK_ATTRS, FROZEN_ATTRS, NONZERO_ATTRS, TYPES

Class Method Summary collapse

Methods inherited from Setting

[], []=, create, create!, #default, #default=, method_missing, #parse_string_value, per_page, #value, #value=

Class Method Details

.load_defaultsObject


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/models/setting/general.rb', line 4

def self.load_defaults  # Check the table exists

  return unless super

  self.transaction do
    domain = Facter.domain
    [
      self.set('administrator', N_("The default administrator email address"), "[email protected]#{domain}"),
      self.set('foreman_url', N_(  "The hostname where your Foreman instance is reachable"), "foreman.#{domain}"),
      self.set('email_reply_address', N_("The email reply address for emails that Foreman is sending"), "[email protected]#{domain}"),
      self.set('entries_per_page', N_("The amount of records shown per page in Foreman"), 20),
      self.set('authorize_login_delegation', N_("Authorize login delegation with REMOTE_USER environment variable"),false),
      self.set('authorize_login_delegation_api', N_("Authorize login delegation with REMOTE_USER environment variable for API calls too"),false),
      self.set('idle_timeout', N_("Log out idle users after a certain number of minutes"),60),
      self.set('max_trend', N_("Max days for Trends graphs"),30),
      self.set('use_gravatar', N_("Should Foreman use gravatar to display user icons"),true)
    ].each { |s| self.create! s.update(:category => "Setting::General")}
  end

  true

end