Module: TestProf::BeforeAll::Adapters::ActiveRecord
- Defined in:
- lib/test_prof/before_all/adapters/active_record.rb
Overview
ActiveRecord adapter for ‘before_all`
Class Method Summary collapse
Class Method Details
.begin_transaction ⇒ Object
14 15 16 17 |
# File 'lib/test_prof/before_all/adapters/active_record.rb', line 14 def begin_transaction lock_thread! ::ActiveRecord::Base.connection.begin_transaction(joinable: false) end |
.rollback_transaction ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/test_prof/before_all/adapters/active_record.rb', line 19 def rollback_transaction if ::ActiveRecord::Base.connection.open_transactions.zero? warn "!!! before_all transaction has been already rollbacked and " \ "could work incorrectly" return end ::ActiveRecord::Base.connection.rollback_transaction end |