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

Don't load AR integration if it is unavailable #188

Merged
merged 1 commit into from
Mar 26, 2023

Conversation

mcmire
Copy link
Collaborator

@mcmire mcmire commented Mar 26, 2023

When writing tests for a project that uses certain parts of Rails, it should still be possible to say require "super_diff/rails", and SuperDiff should only load the integrations that correspond to the available parts. Right now the only two integrations are ActiveSupport and ActiveRecord. ActiveSupport should always be available, but ActiveRecord may not be available, so this commit adds a guard around that integration in particular. It also adds tests for Combustion so we can test that this guard specifically works for engines where ActiveRecord is not being loaded.

When writing tests for a project that uses certain parts of Rails, it
should still be possible to say `require "super_diff/rails"`, and
SuperDiff should only load the integrations that correspond to the
available parts. Right now the only two integrations are ActiveSupport
and ActiveRecord. ActiveSupport should always be available, but
ActiveRecord may not be available, so this commit adds a guard around
that integration in particular. It also adds tests for Combustion so we
can test that this guard specifically works for engines where
ActiveRecord is not being loaded.

Co-authored-by: Harry Lascelles <harry@harryl.com>
Co-authored-by: sshaw <skye.shaw@gmail.com>
@mcmire mcmire merged commit 37cedd6 into main Mar 26, 2023
@mcmire mcmire deleted the dont-require-ar-if-unavailable branch March 26, 2023 02:37
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