When building a has_one relation that is instance dependent, ie. has_one :foo, ->(foo) { where(foo:) }, it is not possible to join on this relation. So something like Bar.joins(fom: :foo) is not possible even though I could construct this join scope myself.
I propose we add another parameter to has_one called :join_scope that contains a proc such as -> { joins(…) } that should be used as the join scope instead of the default join scope.
Curious to know what you think.