Sha256: 1379c065fed281b7a6da8bccba12ce39df5b7290157b5e69d980561d90378ff2
Contents?: true
Size: 775 Bytes
Versions: 31
Compression:
Stored size: 775 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.as(::User.anonymous_api_admin.login) do ForemanTasks.sync_task(::Actions::Katello::Organization::Create, org) unless org.library 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
31 entries across 31 versions & 1 rubygems