Skip to content

Cleanup project for Rails 7+ support #594

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

moberegger
Copy link

@moberegger moberegger commented May 28, 2025

Recommended to review with white space off - most of the changes are adjustments to indentation as a result of removing several if conditions against versions of Rails. Also recommended to review commit by commit.

Support was dropped for EOL Ruby and Rails versions back in September in #570. Part of the motivation to do this was to address some test issues in another PR. Since then, nothing below Ruby 3.0 and Rails 7.0 run as part of the test matrix. Given that the project no longer runs validation against older versions of Ruby and Rails, compatibility can no longer be guaranteed. I think it makes sense to update the project to reflect this reality.

A summary of the changes:

  • gemspec has been updated to specify Ruby 3.0 is the minimum version, as well as specifying 7.0 as the minimum versions for both activesupport and actionview, since this is what the test matrix actually runs against.
  • Test cases have been cleaned up to remove some redundant if conditions against Ruby/Rails versions that would always be true in the test matrix. Likewise, conditions and assertions for older versions have been removed since they would no longer be running under the test matrix.
  • The railtie has been tidied up to assume Rails 7+
  • The CollectionRenderer has been refactored to trust that ::ActionView::CollectionRenderer exists, which is the case for Rails 7+. This allows us to remove the ::ActionView::PartialRenderer shim which also allows us to remove the branch of logic in JbuilderTemplate where CollectionRenderer.supported? is false, which will never be the case anymore in Rails 7+.

@moberegger moberegger changed the title Update gemspec for Rails 7 Cleanup project for Rails 7+ support May 29, 2025
@moberegger moberegger marked this pull request as ready for review May 29, 2025 14:47
@moberegger
Copy link
Author

@rafaelfranca Any concerns here? Is my reasoning sound, or is this change considered too risky?

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