Sha256: faa74fc84166fd71a5aa4b413f90444a6e9f233f72881c3a3a64a7d97c8e6e87

Contents?: true

Size: 577 Bytes

Versions: 19

Compression:

Stored size: 577 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 template.present?
      template.locations = locations if template.present?
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
foreman_remote_execution-3.2.2 db/seeds.d/70-job_templates.rb
foreman_remote_execution-3.2.1 db/seeds.d/70-job_templates.rb
foreman_remote_execution-3.2.0 db/seeds.d/70-job_templates.rb
foreman_remote_execution-3.1.0 db/seeds.d/70-job_templates.rb
foreman_remote_execution-2.0.10 db/seeds.d/70-job_templates.rb
foreman_remote_execution-2.0.9 db/seeds.d/70-job_templates.rb
foreman_remote_execution-2.0.8 db/seeds.d/70-job_templates.rb
foreman_remote_execution-3.0.3 db/seeds.d/70-job_templates.rb
foreman_remote_execution-3.0.2 db/seeds.d/70-job_templates.rb
foreman_remote_execution-2.0.7 db/seeds.d/70-job_templates.rb
foreman_remote_execution-3.0.1 db/seeds.d/70-job_templates.rb
foreman_remote_execution-3.0.0 db/seeds.d/70-job_templates.rb
foreman_remote_execution-2.0.6 db/seeds.d/70-job_templates.rb
foreman_remote_execution-2.0.5 db/seeds.d/70-job_templates.rb
foreman_remote_execution-2.0.4 db/seeds.d/70-job_templates.rb
foreman_remote_execution-2.0.3 db/seeds.d/70-job_templates.rb
foreman_remote_execution-2.0.2 db/seeds.d/70-job_templates.rb
foreman_remote_execution-2.0.1 db/seeds.d/70-job_templates.rb
foreman_remote_execution-2.0.0 db/seeds.d/70-job_templates.rb