Skip to content

Deprecation warning in Rails 5.2rc1 when using self_and_descendants #300

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
timdown opened this issue Feb 19, 2018 · 3 comments
Closed

Deprecation warning in Rails 5.2rc1 when using self_and_descendants #300

timdown opened this issue Feb 19, 2018 · 3 comments

Comments

@timdown
Copy link

timdown commented Feb 19, 2018

The warning in my particular case with a model called Folder is:

DEPRECATION WARNING: Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s): "folder_hierarchies.generations asc". Non-attribute arguments will be disallowed in Rails 6.0. This method should not be called with user-provided values, such as request parameters or model attributes. Known-safe values can be passed by wrapping them in Arel.sql().

@mceachen
Copy link
Collaborator

@timdown feel free to put together a PR--I'm not contributing code to closure_tree anymore, but I'm happy to accept PRs and push new releases. I'm looking for more maintainers, too.

@timdown
Copy link
Author

timdown commented Feb 20, 2018

@mceachen Thought you might say that :) I'll have a go at this in the next week or so but I doubt I'll be able to commit to being a maintainer. By the way, this gem has been great for us. I just dropped it into our project (which involves a hierarchical folder structure) with minimal effort and it's worked flawlessly for years, so thank you for all the work you've done on it.

@timdown
Copy link
Author

timdown commented Feb 27, 2018

Looks like #296 fixed it. I failed to try the latest code before raising this. Sorry.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants