Closed Kulgar closed 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
No feedbacks on my PR?
Thanks @Kulgar it's great 😄
@parndt : thank you for reviewing and accepting my PR :-)
Hello everyone,
I'm doing this little pull request to address a limitation I faced using the gem.
Indeed, I have a "jsonb" column that stores translations like this in my model "Tag" that uses this gem:
label_i18n: { en: "Label", fr: "Sujet" }
I wanted to sort the children of tags like this:
SELECT "tags".* FROM "tags" ORDER BY ("tags"."label_i18n" ->> 'fr') ASC
But I can't do that with the current options as you are forcing the "=> :asc" part.
So... as the "=> :asc" is implicit when you don't specify it, I was just thinking: why not removing it so that the order_column option can accept more complexe options?
I added a spec to test a more complexe option:
{ :name => :desc }
which is a more common usecase than mine I think.Thanks in advance for any feedbacks!