Skip to content

Commit

Permalink
Support legacy Rails
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Oct 28, 2009
1 parent 59dc94e commit 830c426
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/cucumber/rails/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@

Before do
if Cucumber::Rails::World.use_transactional_fixtures
@__cucumber_ar_connections = ActiveRecord::Base.connection_handler.connection_pools.values.map {|pool| pool.connection}
@__cucumber_ar_connections = if ActiveRecord::Base.respond_to?(:connection_handler)
ActiveRecord::Base.connection_handler.connection_pools.values.map {|pool| pool.connection}
else
[ActiveRecord::Base.connection] # Rails <= 2.1.2
end
@__cucumber_ar_connections.each do |__cucumber_ar_connection|
if __cucumber_ar_connection.respond_to?(:increment_open_transactions)
__cucumber_ar_connection.increment_open_transactions
Expand Down

0 comments on commit 830c426

Please sign in to comment.