In certain type of queries (filtering, reporting, etc) it is common have a subquery to select from, currently supported with from, and to join into subqueries (inline views) which is not supported.
I just ran into said situation which I had to solve by doing the subquery as a relationship and calling to_sql and then using the string form of joins.
Like:
subquery = SomeTable
.scope
.scope
.group(:whatever)
.having("something")
.to_sql
OtherTable.joins(“INNER JOIN (#{subquery}) PT ON PT.ID = other_tables.id”)
Would it be possible to implement (or take a PR?) support for this case?
Best regards,