use_parent_strategy is something different (more info on their docs), it tells FactoryBot whether or not to use the parent's strategy (eg: build or create).
For example, given a model User and Country (User belongs_to Country), when use_parent_strategy=true, calling build(:user) will also build (instead of create) the associated Country, because it follows the "parent strategy of build".
However, FactoryBot custom strategies is something different that I want to explore. Perhaps defining a new find_or_create strategy.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
use_parent_strategy
is something different (more info on their docs), it tells FactoryBot whether or not to use the parent's strategy (eg: build or create).For example, given a model User and Country (User belongs_to Country), when use_parent_strategy=true, calling
build(:user)
will also build (instead of create) the associated Country, because it follows the "parent strategy ofbuild
".However, FactoryBot custom strategies is something different that I want to explore. Perhaps defining a new
find_or_create
strategy.