Sha256: 4722e1c68f11bc30f355dcf60f678bd91d48deb556d8cd85050c67ebe61df55c

Contents?: true

Size: 795 Bytes

Versions: 37

Compression:

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

def format_errors(model = nil)
  return '(nil found)' if model.nil?
  model.errors.full_messages.join(';')
end

::User.current = ::User.anonymous_api_admin

# Proxy features
feature = Feature.where(:name => 'Pulp').first_or_create
if feature.nil? || feature.errors.any?
  fail "Unable to create proxy feature: #{format_errors feature}"
end

["Pulp", "Pulp Node"].each do |input|
  f = Feature.where(:name => input).first_or_create
  fail "Unable to create proxy feature: #{format_errors f}" if f.nil? || f.errors.any?
end

::User.current = nil

Version data entries

37 entries across 37 versions & 1 rubygems

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