Class: Setting::StaypuftProvisioning

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

Class Method Summary collapse

Class Method Details

.load_defaultsObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/models/setting/staypuft_provisioning.rb', line 4

def self.load_defaults
  # Check the table exists
  return unless super

  # fixme: not sure about the best way to store AR objects in settings.
  # for now, since we know type, store ID. It might be good to add custom
  # get/set code to decode the ID value into a hostgroup (which methods to call?)
  self.transaction do
    [
     self.set("base_hostgroup", _("The base hostgroup which contains the base provisioning config"), 'base_hostgroup')
    ].compact.each { |s| self.create s.update(:category => "Setting::StaypuftProvisioning")}
  end

  true

end