-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve deprecation warning in preparation for Rails 6 (eventually) #4624
Comments
This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting or reposting it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labelled. Or, if this is not your first time, try to solve it yourself! |
Okay @jywarren so the deprecation warning has changed I think (atleast at my local machine) to this:
Also, the Line 328 in 08d0f7d
So I think we should probably address this new warning now, if I am correct. What do you think? |
Okay so changing this line: plots2/app/services/search_service.rb Line 136 in 08d0f7d
to this:
What do you think should be done? |
@IshaGupta18 What if we change the line |
I am so sorry @snpd25 I missed your comment, let me have a look at it ASAP. |
I think that issue was probably resolved, could you have a look the Deprecation warning I have posted in #4624 (comment) ? Thanks a lot! |
Travis reports this warning several times:
DEPRECATION WARNING: Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s): "COUNT(term_data.tid) DESC". 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(). (called from block in related at /app/app/models/tag.rb:328)
I believe we should wrap
term_data.tid
as recommended, likeArel.sql(term_data.tid)
but am not 100% sure. This should make our test reports much more readable!https://travis-ci.org/publiclab/plots2/builds/479677570#L3230
The line change should be here, i guess:
plots2/app/models/tag.rb
Line 328 in 3e6ce6b
The text was updated successfully, but these errors were encountered: