https://blog.saeloun.com/2021/09/07/rails-7-adds-active-record-relation-structurally-compatible.html
Saeloun Blog
Rails 7 adds ActiveRecord::Relation#structurally_compatible?
Rails 7 adds ActiveRecord::Relation#structurally_compatible? to provide an easy way to check if two relations are structurally compatible before running `or` or `and` query on it.