Sha256: 0ee25b0e9f1a4fc89db00273c4d92db882304cf182d0957475f4de68470f7b2e

Contents?: true

Size: 812 Bytes

Versions: 81

Compression:

Stored size: 812 Bytes

Contents

# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# !!! PLEASE KEEP THIS SCRIPT IDEMPOTENT !!!
#

unless Rails.env.test?
  Organization.all.each do |org|
    User.as(::User.anonymous_api_admin.login) do
      ForemanTasks.sync_task(::Actions::Katello::Organization::Create, org) unless org.library
    end
  end
end

if ENV['SEED_ORGANIZATION']
  if Setting['db_pending_seed']
    admin = User.where(:login => ENV['SEED_ADMIN_USER'].present? ? ENV['SEED_ADMIN_USER'] : 'admin').first
    if admin && admin.default_organization.nil?
      admin.default_organization = Organization.find_by(:name => ENV['SEED_ORGANIZATION'])
      admin.save!
    end
  end
end

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
katello-4.0.3 db/seeds.d/102-organizations.rb
katello-3.18.5 db/seeds.d/102-organizations.rb
katello-4.0.2.1 db/seeds.d/102-organizations.rb
katello-4.0.2 db/seeds.d/102-organizations.rb
katello-3.18.4 db/seeds.d/102-organizations.rb
katello-4.0.1.2 db/seeds.d/102-organizations.rb
katello-3.18.3.1 db/seeds.d/102-organizations.rb
katello-4.0.1.1 db/seeds.d/102-organizations.rb
katello-3.18.3 db/seeds.d/102-organizations.rb
katello-4.0.1 db/seeds.d/102-organizations.rb
katello-4.0.0 db/seeds.d/102-organizations.rb
katello-4.0.0.rc3.1 db/seeds.d/102-organizations.rb
katello-4.0.0.rc3 db/seeds.d/102-organizations.rb
katello-3.18.2.1 db/seeds.d/102-organizations.rb
katello-3.18.2 db/seeds.d/102-organizations.rb
katello-3.17.3 db/seeds.d/102-organizations.rb
katello-4.0.0.rc2 db/seeds.d/102-organizations.rb
katello-3.18.1.1 db/seeds.d/102-organizations.rb
katello-3.17.2 db/seeds.d/102-organizations.rb
katello-4.0.0.rc1 db/seeds.d/102-organizations.rb