Revision 2fb0d8d1
Added by Marek Hulán about 8 years ago
db/seeds.d/08-partition_tables.rb | ||
---|---|---|
# Partition tables
|
||
organizations = Organization.all
|
||
locations = Location.all
|
||
Ptable.without_auditing do
|
||
[
|
||
{ :name => 'AutoYaST entire SCSI disk', :os_family => 'Suse', :source => 'autoyast/disklayout_scsi.erb' },
|
||
... | ... | |
p = Ptable.create({
|
||
:layout => File.read(File.join("#{Rails.root}/app/views/unattended", input.delete(:source)))
|
||
}.merge(input.merge(:default => true)))
|
||
|
||
if p.default?
|
||
p.organizations = organizations if SETTINGS[:organizations_enabled]
|
||
p.locations = locations if SETTINGS[:locations_enabled]
|
||
end
|
||
|
||
raise "Unable to create partition table: #{format_errors p}" if p.nil? || p.errors.any?
|
||
end
|
||
end
|
Also available in: Unified diff
Fixes #14586 - Associate default templates to Orgs and Locs during seed