Sha256: a92577745b87a30ea990253f8d366b2515848331f9c2b54d511f8ac7b1098b1d

Contents?: true

Size: 520 Bytes

Versions: 10

Compression:

Stored size: 520 Bytes

Contents

organizations = Organization.unscoped.all
locations = Location.unscoped.all
User.as_anonymous_admin do
  JobTemplate.without_auditing do
    Dir[File.join("#{ForemanRhCloud::Engine.root}/app/views/job_templates/**/*.erb")].each do |template|
      template = JobTemplate.import_raw!(File.read(template),
        :default => true,
        :lock => true,
        :update => true)
      template.organizations = organizations if template.present?
      template.locations = locations if template.present?
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
foreman_rh_cloud-11.0.3 db/seeds.d/50_job_templates.rb
foreman_rh_cloud-9.0.59 db/seeds.d/50_job_templates.rb
foreman_rh_cloud-11.0.2 db/seeds.d/50_job_templates.rb
foreman_rh_cloud-11.0.1 db/seeds.d/50_job_templates.rb
foreman_rh_cloud-11.0.0 db/seeds.d/50_job_templates.rb
foreman_rh_cloud-9.0.58 db/seeds.d/50_job_templates.rb
foreman_rh_cloud-10.0.2 db/seeds.d/50_job_templates.rb
foreman_rh_cloud-9.0.57 db/seeds.d/50_job_templates.rb
foreman_rh_cloud-10.0.1 db/seeds.d/50_job_templates.rb
foreman_rh_cloud-9.0.56 db/seeds.d/50_job_templates.rb