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

[WIP] Upgrade to Ruby 3.0 #204

Draft
wants to merge 9 commits into
base: upgrade-to-rails-6.1
Choose a base branch
from
Draft

Conversation

patbl
Copy link
Collaborator

@patbl patbl commented Mar 11, 2021

I wanted to see if this is an easy upgrade. It's not.

One big problem is that Roar and Roar Rails (https://github.com/apotonick/roar-rails) aren't maintained, but they're used extensively in the app. Migrating to something else might be formulaic and straightforward, but it would likely require a lot of testing because it would require changing code in a lot of places. An alternative would be to fork Roar and make it compatible with Ruby 3.0. I checked the existing forks (https://github.com/trailblazer/roar/network/members), but none of them had commits more recent than the latest commit in the upstream repo (August 14, 2019).

Anyway, Ruby 2.7 is only a year and a few months old, and will probably be supported for another couple of years. So this upgrade isn't urgent.

We don't use it, and having it enabled makes upgrading Rails harder.
`update_attributes` will be removed in Rails 6.1. This deprecation
warning was being printed:

    update_attributes is deprecated and will be removed from Rails 6.1
    (please, use update instead)
This prevents the following deprecation warning:

    DEPRECATION WARNING: SourceAnnotationExtractor is deprecated! Use
    Rails::SourceAnnotationExtractor instead. (called from <top
    (required)> at
    /Users/pat/projects/guesstimate-server/config/application.rb:12)
This isn't for any reason in particular. We're on and old version and
it's a safe upgrade.
The master branch of actionpack-action_caching has Rails 6.1 support,
but a new version of the gem hasn't been released yet, so we need to
source it from GitHub.

Without the addition of `require "active_support/core_ext/integer/time"`
to `application.rb`, we get this error:

    An error occurred while loading ./spec/models/user_spec.rb.
    Failure/Error: require File.expand_path('../../config/environment', __FILE__)

    NoMethodError:
      undefined method `day' for 1:Integer
This sort of deprecation warning was being printed:

    DEPRECATION WARNING: Calling `<<` to an ActiveModel::Errors message
    array in order to add an error is deprecated. Please call
    `ActiveModel::Errors#add` instead. (called from fact_has_stats at
    /Users/pat/projects/guesstimate-server/app/models/fact.rb:70)
This prevents the following deprecation warning:

    Sending mail with DeliveryJob and Parameterized::DeliveryJob is
    deprecated and will be removed in Rails 6.2. Please use
    MailDeliveryJob instead.
@patbl patbl changed the base branch from master to upgrade-to-rails-6.1 March 11, 2021 01:25
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.

1 participant