-
Notifications
You must be signed in to change notification settings - Fork 2
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
Upgrade ruby and rails #868
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From: https://eaflood.atlassian.net/browse/RUBY-1061 This PR contails all the changes necessary to upgrade the Ruby version from 2.4 to 2.7.1 and Rails version from 4.2 to 6.0.3.1 Some notes about the updates: - Request tests syntax for params and headers to send along with a `get`, `put` or `post` request have changed. Now the params are into a key-value format with the key specifying what are `params` and what are `headers` - With Rails 6, the `rake` command is not invoked directly any more. Instead, we now use `bin/rails`. - Since Rails 6 was built with the. intent to leave the assets work to. NodeJs, we had to require the `sassc-rails` gem on top of the rest of the gems in order for the old way of dealing with assets still works. - `POST` request that do not specify a render will redirected to a `GET` automatically, hence we have to explicitly raise errors now if we want them not to be reachable - Inherithance and scoping are something we must make more attention too. We used to define stuff like: ``` module WasteCarriersEngine class ErrorsController < ApplicationController ``` and trust that ruby would resolve the `ApplicationController` to be the module-scoped definition of it. We can't trust that any more, hence we have to be specific and do stuff like: ``` module WasteCarriersEngine class ErrorsController < ::WasteCarriersEngine::ApplicationController ``` - Parameters on controller coming from a request are not any more instances of the Hash class, but instances of the `ActionController::Parameters` class - The test suite will run in `:random` mode by default - Many of the spec matches we were used to in request tests have been externalised to a gem `rails-controller-testing`
irisfaraway
previously approved these changes
Jun 18, 2020
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.
👏 👏 👏
Also happy to ignore Sonarcloud on this one!
irisfaraway
previously approved these changes
Jun 18, 2020
irisfaraway
previously approved these changes
Jun 18, 2020
Cruikshanks
approved these changes
Jun 26, 2020
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.
Feel free to start merging when ready
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From: https://eaflood.atlassian.net/browse/RUBY-1061
This PR contails all the changes necessary to upgrade the Ruby version from 2.4 to 2.7.1 and Rails version from 4.2 to 6.0.3.1
Some notes about the updates:
get
,put
orpost
request have changed. Now the params are into a key-value format with the key specifying what areparams
and what areheaders
rake
command is not invoked directly any more. Instead, we now usebin/rails
.sassc-rails
gem on top of the rest of the gems in order for the old way of dealing with assets still works.POST
request that do not specify a render will redirected to aGET
automatically, hence we have to explicitly raise errors now if we want them not to be reachableand trust that ruby would resolve the
ApplicationController
to be the module-scoped definition of it. We can't trust that any more, hence we have to be specific and do stuff like:ActionController::Parameters
class:random
mode by defaultrails-controller-testing