-
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
Rails 5.2 upgrade #2927
Rails 5.2 upgrade #2927
Conversation
It keeps on coming! 😄 |
Yeah 😄 |
Generated by 🚫 Danger |
Oh, wow, passing already? Is this ready? |
No, some deprecation warning to be cleared then it will be ready |
Cool, how about now? and... WHATS AFTER 5.2??? 😆 |
Yeah only one deprecation warning is left. I am behind it and after that we will be ready to merge. Actually, we should stop at rails 5.2. what do you think? I guess we should do rails 6.0 update later some time. And I don't know what to do after rails 5.2 upgrade. Is there any project which I could work. I would be really happy working at it. Thank you!! |
its ready to merge @jywarren. That deprecation warning was due to sqlite3 gem which will removed by them later. |
@@ -22,7 +22,7 @@ def places | |||
.references(:term_data) | |||
.where('term_data.name = ?', 'chapter') | |||
.group('node.nid') | |||
.order('max(node_revisions.timestamp) DESC, node.nid') | |||
.order(Arel.sql('max(node_revisions.timestamp) DESC, node.nid')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa, what's this? How does it work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's basically removing the deprecation warning :
DEPRECATION WARNING: Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s): "max(node_revisions.timestamp) DESC, node.nid". 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 places at /app/app/controllers/notes_controller.rb:25)
and as they have written in the warning itself that Known-safe values can be passed by wrapping them in Arel.sql()
. So, I followed them.
OK, awesome - maybe we should insert a comment by this usage referencing
this OK usage?
…On Mon, Jul 2, 2018 at 5:24 PM Sourav Sahoo ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In app/controllers/notes_controller.rb
<#2927 (comment)>:
> @@ -22,7 +22,7 @@ def places
.references(:term_data)
.where('term_data.name = ?', 'chapter')
.group('node.nid')
- .order('max(node_revisions.timestamp) DESC, node.nid')
+ .order(Arel.sql('max(node_revisions.timestamp) DESC, node.nid'))
It's basically removing the deprecation warning :
DEPRECATION WARNING: Dangerous query method (method whose arguments are
used as raw SQL) called with non-attribute argument(s):
"max(node_revisions.timestamp) DESC, node.nid". 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 places at /app/app/controllers/notes_controller.rb:25)
and as they have written in the warning itself that Known-safe values can
be passed by wrapping them in Arel.sql(). So, I followed them.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2927 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABfJx4xHUCACfMxiEx6uxiHXAPJJNXBks5uCo9mgaJpZM4U4wPO>
.
|
Ok about this arel usage right? I will insert a comment. Thank you!! |
d4c28bb
to
29deb58
Compare
@jywarren, Check the comments I have added. Thank you!! |
Looks great! Ill merge now. 🎉 |
Thanks @jywarren |
* Changed the rails version in Gemfile * Modified the mysql version in Gemfile * Added the modified version of Gemfile.lock * Removed some deprecation warnings * Added comment about the usage of Arel.sql * Removed few code climate issues
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
rake test
fixes #0000
-style reference to original issue #@publiclab/reviewers
for help, in a comment belowIf tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.
Thanks!