Sha256: 725dd7d2c95c7f2e7fa3e0a260f8cbb4548535c363887d2e23c1dfa1c7218d1b

Contents?: true

Size: 828 Bytes

Versions: 99

Compression:

Stored size: 828 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", "Container_Gateway"].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

99 entries across 99 versions & 1 rubygems

Version Path
katello-4.15.0.rc2 db/seeds.d/104-proxy.rb
katello-4.15.0.rc1 db/seeds.d/104-proxy.rb
katello-4.14.1 db/seeds.d/104-proxy.rb
katello-4.14.0 db/seeds.d/104-proxy.rb
katello-4.14.0.rc3 db/seeds.d/104-proxy.rb
katello-4.14.0.rc2 db/seeds.d/104-proxy.rb
katello-4.14.0.rc1.1 db/seeds.d/104-proxy.rb
katello-4.14.0.rc1 db/seeds.d/104-proxy.rb
katello-4.13.1 db/seeds.d/104-proxy.rb
katello-4.13.0 db/seeds.d/104-proxy.rb
katello-4.12.1 db/seeds.d/104-proxy.rb
katello-4.13.0.rc1 db/seeds.d/104-proxy.rb
katello-4.12.0 db/seeds.d/104-proxy.rb
katello-4.12.0.rc3 db/seeds.d/104-proxy.rb
katello-4.12.0.rc2 db/seeds.d/104-proxy.rb
katello-4.12.0.rc1 db/seeds.d/104-proxy.rb
katello-4.11.1 db/seeds.d/104-proxy.rb
katello-4.11.0 db/seeds.d/104-proxy.rb
katello-4.11.0.rc2 db/seeds.d/104-proxy.rb
katello-4.11.0.rc1 db/seeds.d/104-proxy.rb