Does Pagy::Keyset support AR relations ordered with SQL string expressions? #740
Answered
by
ddnexus
thomascchen
asked this question in
Q&A
-
Consider the following example: relation = User.order("LOWER(users.name) ASC").order(:id)
keyset = Pagy::Keyset.new(relation) This raises the following error: (irb):54:in `<main>': undefined method `value' for an instance of String (NoMethodError)
keyset[node.value.name.to_sym] = node.direction |
Beta Was this translation helpful? Give feedback.
Answered by
ddnexus
Sep 18, 2024
Replies: 1 comment 2 replies
-
Not out of the box ATM A simple (for us) way of doing it, would require a new feature that we should be able to add easily, and your custom query, run inside an Another way would be supporting it natively, but it would probably complicate the code quite a bit. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
thomascchen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not out of the box ATM
A simple (for us) way of doing it, would require a new feature that we should be able to add easily, and your custom query, run inside an
:after_latest
lambda.Another way would be supporting it natively, but it would probably complicate the code quite a bit.