take-five / activerecord-hierarchical_query

Simple DSL for creating recursive queries with ActiveRecord
MIT License
119 stars 24 forks source link

Fix ordering by multiple columns #39

Closed felipemaier closed 1 year ago

felipemaier commented 1 year ago

The order expression to be inserted into the SELECT clauses of recursive and non-recursive terms included only the first attribute and the rest was being discarded.

Now, we first populate the order expressions into @values and then we call the block once for each element.

smenor commented 1 year ago

@take-five is this getting merged in ?

zachaysan commented 1 year ago

@take-five is this getting merged in ?

Hey @smenor sorry for the delay, I was in the hospital shortly after you opened this PR and it slipped off my radar. I'm going to merge the PR and cut a new gem shortly. I'll let you know if that is successful or not.

zachaysan commented 1 year ago

Oh, and thanks for adding this!!

zachaysan commented 1 year ago

New gem is released @smenor!

https://rubygems.org/gems/activerecord-hierarchical_query

Thanks again for the useful addition and tests!