Sha256: dac111fccfdd91e7d476d813a13c47e22505abf460d25db2a3977229c3943bd6

Contents?: true

Size: 779 Bytes

Versions: 37

Compression:

Stored size: 779 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 !!!
#

Organization.all.each do |org|
  User.current = User.anonymous_admin
  ForemanTasks.sync_task(::Actions::Katello::Organization::Create, org) unless org.library
  User.current = nil
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

37 entries across 37 versions & 1 rubygems

Version Path
katello-3.4.5 db/seeds.d/102-organizations.rb
katello-3.4.4 db/seeds.d/102-organizations.rb
katello-3.4.2 db/seeds.d/102-organizations.rb
katello-3.4.1 db/seeds.d/102-organizations.rb
katello-3.4.0.2 db/seeds.d/102-organizations.rb
katello-3.4.0.1 db/seeds.d/102-organizations.rb
katello-3.3.2 db/seeds.d/102-organizations.rb
katello-3.4.0 db/seeds.d/102-organizations.rb
katello-3.4.0.rc2 db/seeds.d/102-organizations.rb
katello-3.4.0.rc1 db/seeds.d/102-organizations.rb
katello-3.3.1.1 db/seeds.d/102-organizations.rb
katello-3.3.1 db/seeds.d/102-organizations.rb
katello-3.3.0.1 db/seeds.d/102-organizations.rb
katello-3.3.0 db/seeds.d/102-organizations.rb
katello-3.3.0.rc2 db/seeds.d/102-organizations.rb
katello-3.3.0.rc1.1 db/seeds.d/102-organizations.rb
katello-3.3.0.rc1 db/seeds.d/102-organizations.rb
katello-3.2.1.1 db/seeds.d/102-organizations.rb
katello-3.2.1 db/seeds.d/102-organizations.rb
katello-3.2.0 db/seeds.d/102-organizations.rb