You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We discovered that a factory will be invalid if it explicitly sets the "active" state in the default factory:
# factorystatus{"active"}# usageFactoryBot.create(:my_factory)#!> ActiveRecord::RecordInvalid: Validation failed: Status is invalidFactoryBot.create(:my_factory,status: 'active')#!> ActiveRecord::RecordInvalid: Validation failed: Status is invalidFactoryBot.create(:my_factory,status: 'inactive')#!> works
The fix is to remove the status { "active" } from the factory
The text was updated successfully, but these errors were encountered:
Circling back after resolving this offline -- it turns out that #6 was the culprit here. There may be something we can do to detect default values on columns and warn the developer.
Given this state machine:
We discovered that a factory will be invalid if it explicitly sets the "active" state in the default factory:
The fix is to remove the
status { "active" }
from the factoryThe text was updated successfully, but these errors were encountered: