thoughtbot / factory_bot

A library for setting up Ruby objects as test data.
https://thoughtbot.com
MIT License
7.91k stars 2.6k forks source link

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

Open Talha345 opened 1 year ago

Talha345 commented 1 year ago

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

composerinteralia commented 1 year ago

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.