This PR makes it possible to have OneToOneThrough in factories. This is incredibly important since oftentimes, one-to-one-throughs are critical when refactoring coupled relations in a codebase.
Caveats
I cannot get factories.struct(:user) to work with this. There is some strange stuff happening where the schema inferencing from the model expects a user_id on addresses, despite it being a has_one. I don't know how to resolve that. I believe there is some strange schema merging going on, but I do not have enough context to debug it. @solnic can someone help me with this?
This PR makes it possible to have
OneToOneThrough
in factories. This is incredibly important since oftentimes, one-to-one-throughs are critical when refactoring coupled relations in a codebase.Caveats
I cannot get
factories.struct(:user)
to work with this. There is some strange stuff happening where the schema inferencing from the model expects auser_id
onaddresses
, despite it being ahas_one
. I don't know how to resolve that. I believe there is some strange schema merging going on, but I do not have enough context to debug it. @solnic can someone help me with this?Click here to show the backtrace
Summary
Overall, I think this PR is ready to go even without structs for now, wdyt?