From a74f07d5074d3addea668beb33803cc1dfc9c74d Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 28 Nov 2023 18:25:35 +0000 Subject: [PATCH] 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 --- config/environments/test.rb | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.5