Skip to content
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

Merged
merged 6 commits into from
Jul 2, 2018
Merged

Rails 5.2 upgrade #2927

merged 6 commits into from
Jul 2, 2018

Conversation

Souravirus
Copy link
Member

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • PR body includes fixes #0000-style reference to original issue #
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If 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!

@ghost ghost assigned Souravirus Jun 26, 2018
@ghost ghost added the in progress label Jun 26, 2018
@jywarren
Copy link
Member

It keeps on coming! 😄

@Souravirus
Copy link
Member Author

Yeah 😄

@plotsbot
Copy link
Collaborator

plotsbot commented Jun 27, 2018

2 Messages
📖 @Souravirus Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.
📖 It looks like you haven’t marked all the checkboxes. Help us review and accept your suggested changes by going through the steps one by one. If it is still a ‘Work in progresss’, please include ‘[WIP]’ in the title.

Generated by 🚫 Danger

@jywarren
Copy link
Member

jywarren commented Jul 2, 2018

Oh, wow, passing already? Is this ready?

@Souravirus
Copy link
Member Author

No, some deprecation warning to be cleared then it will be ready

@jywarren
Copy link
Member

jywarren commented Jul 2, 2018

Cool, how about now? and... WHATS AFTER 5.2??? 😆

@Souravirus
Copy link
Member Author

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!!

@Souravirus
Copy link
Member Author

Souravirus commented Jul 2, 2018

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'))
Copy link
Member

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?

Copy link
Member Author

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.

@jywarren
Copy link
Member

jywarren commented Jul 2, 2018 via email

@Souravirus
Copy link
Member Author

Ok about this arel usage right? I will insert a comment. Thank you!!

@Souravirus
Copy link
Member Author

@jywarren, Check the comments I have added. Thank you!!

@jywarren
Copy link
Member

jywarren commented Jul 2, 2018

Looks great! Ill merge now. 🎉

@jywarren jywarren merged commit 73a16d1 into master Jul 2, 2018
@ghost ghost removed the ready label Jul 2, 2018
@Souravirus Souravirus deleted the rails5.2_upgrade branch July 3, 2018 05:36
@Souravirus
Copy link
Member Author

Thanks @jywarren

SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants