Rails 8.1 support - #303
Merged
Merged
Conversation
Now that Rails 8.1 has been released, let's not support the betas anymore. Also, now that edge rails (8.2 beta) has started removing the need for the connection to fetch default attributes, let's not apply the monkeypatch when running edge.
There was a problem hiding this comment.
Pull request overview
This PR updates activerecord-tenanted to support Rails 8.1 and adds CI coverage for both Rails 8.1 and Rails edge while tightening the gem’s minimum supported Rails version to >= 8.1.0.
Changes:
- Add an Appraisal-based Rails version matrix (Rails
~> 8.1.0andrails/main) and run unit/integration CI against each. - Make the ActiveRecord Attributes monkey patch conditional to avoid applying it on versions where it’s not needed.
- Update contributing docs and test scripts to support running tests across the matrix via
BUNDLE_GEMFILE/Appraisal.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/test_helper.rb | Prints Rails version at test start for easier debugging across the matrix. |
| test/smarty/test/test_helper.rb | Prints Rails version at test start for smarty app tests. |
| lib/active_record/tenanted/railtie.rb | Switches Attributes patch application to a conditional apply_patch hook. |
| lib/active_record/tenanted/patches.rb | Adds conditional patch gating logic for the Attributes monkey patch. |
| gemfiles/rails_edge.gemfile | Adds an Appraisal-generated Gemfile for Rails edge. |
| gemfiles/rails_8_1.gemfile | Adds an Appraisal-generated Gemfile for Rails 8.1. |
| Gemfile.lock | Updates locked dependencies and bumps Rails git revision; reflects new dependency constraints. |
| Gemfile | Introduces Appraisal/minitest deps and adjusts Rails dependency placement. |
| CONTRIBUTING.md | Documents how to generate/install appraisals and run tests across the matrix. |
| bin/test-integration | Uses BUNDLE_GEMFILE if set, enabling appraisal-driven integration runs. |
| Appraisals | Defines the Rails 8.1 and Rails edge appraisals. |
| activerecord-tenanted.gemspec | Bumps minimum supported Rails to >= 8.1.0 (dropping 8.1 beta support). |
| .gitignore | Ignores generated appraisal lockfiles. |
| .github/workflows/ci.yml | Adds a matrix over appraisal gemfiles for unit/integration CI; allows edge failures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+47
to
+51
| # This monkey patch isn't necessary after 8.1 removed the need for a connection. | ||
| # For details see https://github.com/rails/rails/pull/54348 | ||
| def needs_patch? | ||
| Gem::Requirement.new("~> 8.1.0").satisfied_by?(Gem::Version.new(Rails::VERSION::STRING)) | ||
| end |
This file contains hidden or 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
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.
>= 8.1.0(removing support for 8.1 beta versions)