Skip to content

Upgrade Rails to 8.1#7019

Draft
stefannibrasil wants to merge 11 commits into
rubyforgood:mainfrom
hexdevs:upgrade-to-rails-8.1
Draft

Upgrade Rails to 8.1#7019
stefannibrasil wants to merge 11 commits into
rubyforgood:mainfrom
hexdevs:upgrade-to-rails-8.1

Conversation

@stefannibrasil

@stefannibrasil stefannibrasil commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What github issue is this PR for, if any?

Closes #7018

What changed, and why?

Following up on #6925, this upgrades Rails to 8.1.

Important things for review

  • The new defaults from config/initializers/new_framework_defaults_8_1.rb look okay to be enabled altogether (you can review them in this commit). I enabled 8.1 config defaults but if you prefer to enable them individually, let me know.
  • Note that with this version, Rails orders the columns alphabetically in db/schema.rb. This commit shows the updated schema (no functional change, just the reorder changes): 2f013de
  • I had to simplify the random date generation in the seed task due to a date range error. More details can be found in this commit. I believe this is a safe choice since this is just a seed task that is ran sporadically.

How is this tested? (please write rspec and jest tests!) 💖💪

  • tested the app locally
  • running tests
  • CI is passing

Followups

Questions

Is it possible to test this on staging/QA first? Please try this out locally and let me know if you run into any issues.

@github-actions github-actions Bot added dependencies Touches dependency files ruby Touches Ruby code db Touches database schema or migrations labels Jun 18, 2026
@stefannibrasil stefannibrasil changed the title Upgrade to rails 8.1 Upgrade Rails to 8.1 Jun 18, 2026
After the upgrade, this test was raising this error:

```
  Failure/Error: ActiveRecord::Tasks::DatabaseTasks.load_seed

     ArgumentError:
      cannot load complex into simple
     # ./db/seeds/db_populator.rb:143:in 'block in DbPopulator#create_cases'
     # ./db/seeds/db_populator.rb:137:in 'Integer#times'
     # ./db/seeds/db_populator.rb:137:in 'DbPopulator#create_cases'
```

Keeping the date to a simpler rand generation solves
the problem.
This version new defaults do not seem to impact
this app.
@stefannibrasil stefannibrasil force-pushed the upgrade-to-rails-8.1 branch from 8b9bc3a to 1cc0946 Compare July 2, 2026 22:13
@stefannibrasil stefannibrasil marked this pull request as ready for review July 2, 2026 22:23
@stefannibrasil stefannibrasil marked this pull request as draft July 2, 2026 22:23
@stefannibrasil

Copy link
Copy Markdown
Contributor Author

This can be merged after #7017 has been deployed successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db Touches database schema or migrations dependencies Touches dependency files ruby Touches Ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade Rails from 8.0 to 8.1

1 participant