-
Notifications
You must be signed in to change notification settings - Fork 0
Cleanup project for Rails 7+ support #3
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
end | ||
end | ||
|
||
# Rails 6.1 support: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this func still needed then?
(the each_with_info func)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is. It really should have said "Rails >= 6.1 support".
def collection_with_template(view, template, layout, collection) | ||
super(view, template, layout, ScopedIterator.new(collection, @scope)) | ||
end | ||
def initialize(lookup_context, options, &scope) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This initialize was part of CollectionRenderer - since you're removing its definition is this initialize still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CollectionRenderer
is still being defined. The PR is removing the CollectionRenderer
defined for < Rails 6.1.
class CollectionRenderer < ::ActionView::PartialRenderer
is gone.
class CollectionRenderer < ::ActionView::CollectionRenderer
remains.
CollectionRenderer
was being conditionally defined via if defined?(::ActionView::CollectionRenderer)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ a few q's
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 rails#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 bothactivesupport
andactionview
, since this is what the test matrix actually runs against.if
conditions against Ruby/Rails versions that would always betrue
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.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 inJbuilderTemplate
whereCollectionRenderer.supported?
isfalse
, which will never be the case anymore in Rails 7+.This also been filed upstream: rails#594