From: Tom Hughes Date: Tue, 28 Nov 2023 18:25:35 +0000 (+0000) Subject: Allow FactoryBot to set primary key attributes X-Git-Tag: live~913 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/a74f07d5074d3addea668beb33803cc1dfc9c74d Allow FactoryBot to set primary key attributes We have at least model (Language) which does not use datbase generated primary keys so we need to be able to set them. https://github.com/thoughtbot/factory_bot_rails/pull/419 --- diff --git a/config/environments/test.rb b/config/environments/test.rb index 08d3236bf..80871151f 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -67,4 +67,7 @@ Rails.application.configure do # Use the test adapter for ActiveJob during testing. config.active_job.queue_adapter = :test + + # Allow FactoryBot to set primary key attributes + config.factory_bot.reject_primary_key_attributes = false end