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

Handle nil dependencies in case of inheritance #1620

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

LTe
Copy link
Contributor

@LTe LTe commented Aug 24, 2023

Motivation

When you inherit from class that extends ActiveSupport::Concern it will break DSL compiler ActiveSupportConcern.

Implementation

This commit modifies the dependencies_of method in the ActiveSupport::Concern compiler to ensure it returns an empty array when the concern has no dependencies, preventing potential nil errors.

A new test ensures that constants inheriting from a class extending ActiveSupport::Concern are not gathered, ensuring only direct dependencies are included.

Tests

I added specs

This commit modifies the `dependencies_of` method in the
ActiveSupport::Concern compiler to ensure it returns an empty array
when the concern has no dependencies, preventing potential `nil` errors.

A new test ensures that constants inheriting from a class extending
ActiveSupport::Concern are not gathered, ensuring only direct
dependencies are included.
@LTe LTe requested a review from a team as a code owner August 24, 2023 11:02
@LTe LTe requested review from Morriar and st0012 August 24, 2023 11:02
@KaanOzkan KaanOzkan merged commit b1dd52e into Shopify:main Aug 28, 2023
15 checks passed
@shopify-shipit shopify-shipit bot temporarily deployed to production September 13, 2023 22:55 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants