Sha256: bb04c0cb8149a92656a7fc736742e07f8a962507566a9cd80b17dc139de9852c

Contents?: true

Size: 807 Bytes

Versions: 47

Compression:

Stored size: 807 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.as(::User.anonymous_api_admin.login) do
  # 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", "Pulpcore"].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
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
katello-3.18.5 db/seeds.d/104-proxy.rb
katello-3.18.4 db/seeds.d/104-proxy.rb
katello-3.18.3.1 db/seeds.d/104-proxy.rb
katello-3.18.3 db/seeds.d/104-proxy.rb
katello-3.18.2.1 db/seeds.d/104-proxy.rb
katello-3.18.2 db/seeds.d/104-proxy.rb
katello-3.17.3 db/seeds.d/104-proxy.rb
katello-3.18.1.1 db/seeds.d/104-proxy.rb
katello-3.17.2 db/seeds.d/104-proxy.rb
katello-3.18.1 db/seeds.d/104-proxy.rb
katello-3.18.0 db/seeds.d/104-proxy.rb
katello-3.17.1 db/seeds.d/104-proxy.rb
katello-3.16.2 db/seeds.d/104-proxy.rb
katello-3.18.0.rc2.1 db/seeds.d/104-proxy.rb
katello-3.18.0.rc2 db/seeds.d/104-proxy.rb
katello-3.17.0 db/seeds.d/104-proxy.rb
katello-3.18.0.rc1 db/seeds.d/104-proxy.rb
katello-3.17.0.rc2.2 db/seeds.d/104-proxy.rb
katello-3.17.0.rc2.1 db/seeds.d/104-proxy.rb
katello-3.16.1.2 db/seeds.d/104-proxy.rb