Sha256: 1bc6bad614272f54fe1f56c9e5b3640a0d1045c2f9f64ed4692e1ddc8a30cf86

Contents?: true

Size: 569 Bytes

Versions: 13

Compression:

Stored size: 569 Bytes

Contents

# frozen_string_literal: true

User.as_anonymous_admin do
  JobTemplate.without_auditing do
    Dir[File.join("#{ForemanAcd::Engine.root}/app/views/templates/**/*.erb")].each do |template|
      sync = !Rails.env.test? && Setting[:remote_execution_sync_templates]
      template = JobTemplate.import_raw!(File.read(template), :default => true, :lock => true, :update => sync)

      template.organizations << Organization.unscoped.all if template&.organizations&.empty?
      template.locations << Location.unscoped.all if template&.locations&.empty?
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
foreman_acd-0.11.0 db/seeds.d/75-job_templates.rb
foreman_acd-0.10.0 db/seeds.d/75-job_templates.rb
foreman_acd-0.9.7 db/seeds.d/75-job_templates.rb
foreman_acd-0.9.5 db/seeds.d/75-job_templates.rb
foreman_acd-0.9.4 db/seeds.d/75-job_templates.rb
foreman_acd-0.9.3 db/seeds.d/75-job_templates.rb
foreman_acd-0.9.2.3 db/seeds.d/75-job_templates.rb
foreman_acd-0.9.2.2 db/seeds.d/75-job_templates.rb
foreman_acd-0.9.2.1 db/seeds.d/75-job_templates.rb
foreman_acd-0.9.2 db/seeds.d/75-job_templates.rb
foreman_acd-0.9.1 db/seeds.d/75-job_templates.rb
foreman_acd-0.9.0 db/seeds.d/75-job_templates.rb
foreman_acd-0.7.0 db/seeds.d/75-job_templates.rb