Closed jhawthorn closed 6 years ago
Looks like this doesn't agree with Rails 3.2, which does very silly things when passed symbols.
Do we want to continue Supporting Rails 3.2. If so, we'll probably have to add conditionals on each of these reorder calls
That's a hard one. Having been in a place where longer term support for older rails versions was a blessing, I'd like to keep support. But perhaps it's time to go Rails 4.0+? @swanandp, what do you think? You could use a new method instead of position_column
, then put the conditional on that method to either return the symbol or the quoted string for Rails 3.2.
@jhawthorn @brendon The symbol fork works for me on Rails 5.2. The forest of deprecation warnings in the CI has been reduced drastically. 👍
Ha @Petercopter! Glad it's a good fix. @jhawthorn, did you want to try abstracting the position_column for reordering purposes into a method that either returns a symbol or the table name and column depending on Rails 3.2?
I'm happy with that now. I've merged this. We'll need to add 5.2 to the test suite and make sure everything else passes.
Fix looks good to me. Thanks for your help resolving this! 🍺 🍸 🍹
Yes thanks @jhawthorn for your work on this! :)
Fixes #290
Passing strings to order/reorder is deprecated in Rails 5.2.
There was some concern in #290 about having issues with ambiguous column names. That shouldn't ever be an issue when using symbols (rails will quot it properly), and we already have a test for it :tada:!