Sha256: bc49de0a13f80a04ed90bdf72649c7c4356ffe154512b17dd6294c46bcca75b8

Contents?: true

Size: 645 Bytes

Versions: 19

Compression:

Stored size: 645 Bytes

Contents

organizations = Organization.unscoped.all
locations = Location.unscoped.all
User.as_anonymous_admin do
  JobTemplate.without_auditing do
    Dir[File.join("#{ForemanRemoteExecution::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, :locked => true, :update => sync)
      template.organizations = organizations if SETTINGS[:organizations_enabled] && template.present?
      template.locations = locations if SETTINGS[:locations_enabled] && template.present?
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
foreman_remote_execution-1.8.4 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.8.3 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.8.2 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.8.1 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.8.0 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.7.1 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.7.0 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.6.7 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.6.6 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.6.5 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.6.4 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.5.6 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.6.3 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.6.2 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.5.5 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.6.1 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.6.0 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.5.4 db/seeds.d/70-job_templates.rb
foreman_remote_execution-1.5.3 db/seeds.d/70-job_templates.rb