kenn / standby

Read from standby databases for ActiveRecord
MIT License
87 stars 28 forks source link

Corrects transactional fixture check for Rails 5 #21

Closed jrforrest closed 6 years ago

jrforrest commented 6 years ago

In Rails 5 ActiveSupport::TestCase now uses use_transactional_tests rather than use_transactional_fixtures as its method to check whether transactional fixtures are being utilized for the current test.

See: https://github.com/rails/rails/pull/19282

I'm in the middle of a Rails 5 upgrade on an app using Slavery and this was causing

      Slavery::Error:
        on_slave cannot be used inside transaction block!

when using Slavery.on_slave.

kenn commented 6 years ago

Thanks! It looks like it's failing for Rails 3.2, do you have any idea to fix it?

kenn commented 6 years ago

https://travis-ci.org/kenn/slavery/builds/267382318

jrforrest commented 6 years ago

Huh, sorry I didn't notice that before opening the PR. Looks like try behavior was a little different back then? This should do it.

kenn commented 6 years ago

Perfect. Thanks! 🎉