Sha256: 9b286b1ba051db19cf02166ddfa53a0b7bfaa661d49b6bbd144f7466c8c55a80

Contents?: true

Size: 663 Bytes

Versions: 25

Compression:

Stored size: 663 Bytes

Contents

if ForemanOpenscap.with_remote_execution?
  User.as_anonymous_admin do
    JobTemplate.without_auditing do
      Dir[File.join("#{ForemanOpenscap::Engine.root}/app/views/job_templates/**/*.erb")].each do |template|
        sync = !Rails.env.test? && Setting[:remote_execution_sync_templates]
        # import! was renamed to import_raw! around 1.3.1
        if JobTemplate.respond_to?('import_raw!')
          JobTemplate.import_raw!(File.read(template), :default => true, :locked => true, :update => sync)
        else
          JobTemplate.import!(File.read(template), :default => true, :locked => true, :update => sync)
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
foreman_openscap-0.10.1 db/seeds.d/75-job_templates.rb
foreman_openscap-0.9.3 db/seeds.d/75-job_templates.rb
foreman_openscap-0.10.0 db/seeds.d/75-job_templates.rb
foreman_openscap-0.7.13 db/seeds.d/75-job_templates.rb
foreman_openscap-0.8.6 db/seeds.d/75-job_templates.rb
foreman_openscap-0.9.2 db/seeds.d/75-job_templates.rb
foreman_openscap-0.9.1 db/seeds.d/75-job_templates.rb
foreman_openscap-0.8.5 db/seeds.d/75-job_templates.rb
foreman_openscap-0.7.12 db/seeds.d/75-job_templates.rb
foreman_openscap-0.9.0 db/seeds.d/75-job_templates.rb
foreman_openscap-0.8.4 db/seeds.d/75-job_templates.rb
foreman_openscap-0.7.11 db/seeds.d/75-job_templates.rb
foreman_openscap-0.7.10 db/seeds.d/75-job_templates.rb
foreman_openscap-0.8.3 db/seeds.d/75-job_templates.rb
foreman_openscap-0.7.9 db/seeds.d/75-job_templates.rb
foreman_openscap-0.7.8 db/seeds.d/75-job_templates.rb
foreman_openscap-0.7.7 db/seeds.d/75-job_templates.rb
foreman_openscap-0.8.2 db/seeds.d/75-job_templates.rb
foreman_openscap-0.7.6 db/seeds.d/75-job_templates.rb
foreman_openscap-0.8.1 db/seeds.d/75-job_templates.rb