Skip to content

Update to Rails 4.2#199

Merged
tom93 merged 2 commits intomasterfrom
rails-4-2
Dec 28, 2023
Merged

Update to Rails 4.2#199
tom93 merged 2 commits intomasterfrom
rails-4-2

Conversation

@bagedevimo
Copy link
Contributor

Steps:

  • Update Gemfile
  • bundle update --conservative rails actionpack railties activerecord activemodel activesupport rack responders

There are lots of warnings & deprecations, but nothing is failing in
the test suite.

Copy link
Contributor Author

bagedevimo commented Dec 21, 2023

@bagedevimo bagedevimo force-pushed the rails-4-2 branch 2 times, most recently from 690e1ea to 6979977 Compare December 21, 2023 08:46
@bagedevimo bagedevimo changed the base branch from master to 12-21-Extract_DevelopmentMailInterceptor_setup_from_config/environment December 21, 2023 08:46
@bagedevimo bagedevimo force-pushed the 12-21-Extract_DevelopmentMailInterceptor_setup_from_config/environment branch 2 times, most recently from 88453ec to 8d27564 Compare December 21, 2023 09:44
Base automatically changed from 12-21-Extract_DevelopmentMailInterceptor_setup_from_config/environment to master December 22, 2023 06:34
Holmes98
Holmes98 previously approved these changes Dec 23, 2023
Copy link
Contributor

@tom93 tom93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor:

There is a change to Rack that makes it listen on localhost instead of 0.0.0.0 in development to only allow connections from the current host (source).

A side effect of this is that on some systems localhost might resolve to IPv6, which means connecting via 127.0.0.1 fails. I'd like to be able to continue using 127.0.0.1; looking into this.

Edit: Better (official) source. It says "both http://127.0.0.1:3000/ and http://localhost:3000/ will continue to work" but that's not the case for me. I know I can use rails server -b 127.0.0.1 but that's annoying. I'm thinking of using the trick from here (found via Stack Overflow and the FastRuby article), but with 127.0.0.1 instead of 0.0.0.0. (Separate PR.)

@tom93
Copy link
Contributor

tom93 commented Dec 23, 2023

Re commit message: I have draft fixes for two classes of deprecations in #219 and #220, only one left:

DEPRECATION WARNING: The configuration option config.serve_static_assets has been renamed to config.serve_static_files to clarify its role (it merely enables serving everything in the public folder and is unrelated to the asset pipeline). The serve_static_assets alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /home/user/nztrain/config/environments/test.rb:37)

@bagedevimo
Copy link
Contributor Author

Minor:

There is a change to Rack that makes it listen on localhost instead of 0.0.0.0 in development to only allow connections from the current host (source).

A side effect of this is that on some systems localhost might resolve to IPv6, which means connecting via 127.0.0.1 fails. I'd like to be able to continue using 127.0.0.1; looking into this.

Edit: Better (official) source. It says "both http://127.0.0.1:3000/ and http://localhost:3000/ will continue to work" but that's not the case for me. I know I can use rails server -b 127.0.0.1 but that's annoying. I'm thinking of using the trick from here (found via Stack Overflow and the FastRuby article), but with 127.0.0.1 instead of 0.0.0.0. (Separate PR.)

Ha, I didn't notice this because i've been doing local development with -b 0.0.0.0 intentionally

@bagedevimo
Copy link
Contributor Author

Re commit message: I have draft fixes for two classes of deprecations in #219 and #220, only one left:

DEPRECATION WARNING: The configuration option config.serve_static_assets has been renamed to config.serve_static_files to clarify its role (it merely enables serving everything in the public folder and is unrelated to the asset pipeline). The serve_static_assets alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /home/user/nztrain/config/environments/test.rb:37)

Awesome - I still think it's worth merging these all separately and potentially even deploying, then merging the fixes. Makes it a little easier to spot issues that occurred due to the upgrade vs due to fixing the deprecs - but i'm not very passionate about this.

Steps:
* Update Gemfile
* bundle update --conservative rails actionpack railties activerecord activemodel activesupport rack responders

There are lots of warnings & deprecations, but nothing is _failing_ in
the test suite.
Rails moved these out to a seperate gem, and we're currently okay because devise
depends on this, but seeing how we're explicitly using these features we should
take an explict dependency.

[1] https://guides.rubyonrails.org/4_2_release_notes.html#respond-with-class-level-respond-to
@tom93 tom93 merged commit 6c98d1f into master Dec 28, 2023
@tom93 tom93 deleted the rails-4-2 branch December 28, 2023 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants