Does rom-sql support something like Sequel's #from_self?

In Sequel there is a #from_self method, which returns a dataset selecting from the current dataset.

I want to achieve this with rom-rb. Is it possible?

I tried lots of things without success.

I.e. {
          # sum(total_price).as(:total_price), # sequel dsl
          integer::sum(:total_price).as(:total_price), # rom dsl


You can try to do forward :from_self within your Relation class and it will define Relation#from_self that should just work.

1 Like

Wow! Thank you. That works! :grinning:

1 Like