Skip to content

Conversation

@jherdman
Copy link

No description provided.

Smart Listing supports three states for sorting:

1. "asc": ascending order using a given column of a table
2. "desc": descending order using a given column of a table
3. "": default ordering for the table (e.g. if you want to order by
   "name" by default, but allow sorting on "created at", you'd want
   this state to return the table to its default order)

When attempting to use the default ordering _as requested by the user_
Smart Listing would construct a query attribute like this:
`"fulfillment_order_sources.name "` (note extra space at the end).
Rails 6.0 was okay with this, 6.1 is not.
Rails 6.0 is okay with something like this:

    "fulfillment_order_sources.name"

Rails 6.1 is not. You have to parse this first.
@jherdman jherdman closed this Jan 26, 2021
@jherdman jherdman reopened this Jan 26, 2021
jherdman and others added 2 commits January 29, 2021 15:58
Co-authored-by: Justin Giancola <justin.giancola@gmail.com>
@avishekjana
Copy link

@jherdman Have you found any way to use smart_listing in Rails 6?

@jherdman
Copy link
Author

My employer has a fork here https://github.com/PrecisionNutrition/smart_listing. I absolutely do not recommend using our fork. We will change it as need be, but are intending on moving away from Smart Listing ASAP. You're free to lift the code out into your own fork, or even attempt to have it upstreamed should that be possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants