Sha256: 56a573fd4f957a1a48080372e417af7e7bc9a9a9fc5658977ec8904e96e67cbe
Contents?: true
Size: 804 Bytes
Versions: 18
Compression:
Stored size: 804 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", "Pulp3"].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
18 entries across 18 versions & 1 rubygems