Module: Kangaru::Initialisers::RSpec::KangaruHelper
- Defined in:
- lib/kangaru/initialisers/rspec/kangaru_helper.rb
Instance Method Summary collapse
Instance Method Details
#run_in_transaction(&block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/kangaru/initialisers/rspec/kangaru_helper.rb', line 5 def run_in_transaction(&block) database = Kangaru.application&.database return block.call if database.nil? database.transaction do block.call database.rollback_on_exit end end |