factory_bot icon indicating copy to clipboard operation
factory_bot copied to clipboard

Invalid Boolean value being stored when enabling eager_load = true in Test Env

Open Talha345 opened this issue 1 year ago • 1 comments

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

Talha345 avatar Nov 22 '22 21:11 Talha345

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.

composerinteralia avatar Nov 23 '22 00:11 composerinteralia