Skip to content

Conversation

@tagliala
Copy link

Rails 4.2 does not have use_transactional_tests defined

Fix #2477

Supersedes #2479 (I was using a wrong branch)

Rails 4.2 does not have `use_transactional_tests` defined

Fix rspec#2477
# 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
Author

Choose a reason for hiding this comment

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

This check is inspired by

if ::Rails::VERSION::STRING > '5'

@tagliala tagliala marked this pull request as draft March 10, 2021 16:50
Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!
Please add a Changelog record.

@tagliala
Copy link
Author

Is the failure RSpec CI / Ruby: 2.6.6, Rails: ~> 5.1.0 (pull_request) expected?

@pirj
Copy link
Member

pirj commented Mar 10, 2021

Might be just flaky. Let's see if it reappears after Changelog changes.

@JonRowe JonRowe marked this pull request as ready for review March 10, 2021 18:34
@JonRowe JonRowe merged commit 9629a72 into rspec:4-1-maintenance Mar 10, 2021
@pirj
Copy link
Member

pirj commented Mar 10, 2021

Thank you!

JonRowe added a commit that referenced this pull request Mar 10, 2021
@JonRowe
Copy link
Member

JonRowe commented Mar 10, 2021

Thanks, this will be released later today as 4.1.2.

(Please note future travellers, this does not mean we are supporting Rails 4.2 on this series of RSpec, this was an exception to the rule 😃 )

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.

3 participants