factory_bot
factory_bot copied to clipboard
Invalid Boolean value being stored when enabling eager_load = true in Test Env
Description
We have the following factory.
factory :business_partner do name { Faker::name } company { true } location client default_company { true } end
The Factory works fine when using eager_load = false
in the test environment.However, enabling eager_load the value for the default_company is stored as false
which is also set as the default value on Model and DB level for this column.
Reproduction Steps
Run FactoryBot.create(:business_partner)
on a Rails console.
System configuration
factory_bot_rails version: 6.2.0 factory_bot version: 6.2.1 rails version: 6.1.6 ruby version: 3.0.4
This sounds more like an application setup bug than a factory_bot bug, but there's also not enough information here to help. We'd need either a reproduction script or a sample application that reproduces the problem to help further.