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

Fix support for Rails 4.2 #2479

Closed
wants to merge 0 commits into from

Conversation

tagliala
Copy link

Rails 4.2 does not have use_transactional_tests defined

Fix #2477

@@ -13,7 +13,11 @@ module FixtureSupport
# Monkey patched to avoid collisions with 'let(:name)' in Rails 6.1 and after
# and let(:method_name) before Rails 6.1.
def run_in_transaction?
use_transactional_tests && !self.class.uses_transaction?(self)
if ::Rails::VERSION::STRING > '5'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, we define conditional methods rather than use run time checks, and this should probably check for the existence of use_transactional_tests directly rather than a version, although if you leave it on a version it should be >= 5

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.

2 participants