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