Fixed seeding issue with FactoryBot

Frank saw an issue during seeding of a new server.
This is a fix from Wieland under Frank's name...
pull/10123/head
Frank Bergmann 3 years ago
parent 3c36c7dec8
commit 0425c553dc
  1. 4
      app/seeders/development_data/custom_fields_seeder.rb

@ -47,14 +47,14 @@ module DevelopmentData
def create_types!(cfs)
# Create ALL CFs types
non_req_cfs = cfs.reject(&:is_required).map { |cf| "custom_field_#{cf.id}" }
type = build :type, name: 'All CFS'
type = FactoryBot.build :type, name: 'All CFS'
extend_group(type, ['Custom fields', non_req_cfs])
type.save!
print_status '.'
# Create type
req_cfs = cfs.select(&:is_required).map { |cf| "custom_field_#{cf.id}" }
type_req = build :type, name: 'Required CF'
type_req = FactoryBot.build :type, name: 'Required CF'
extend_group(type_req, ['Custom fields', req_cfs])
type_req.save!
print_status '.'

Loading…
Cancel
Save