Skip to content

Commit

Permalink
Fix typo: was using brackets instead of parens. Must need more sleep.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksieger committed Aug 29, 2008
1 parent 1712e37 commit d7d2d73
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Expand Up @@ -266,7 +266,7 @@ def checkout_new_connection
end

def checkout_existing_connection
c = [@connections - @checked_out].first
c = (@connections - @checked_out).first
@checked_out << c
c
end
Expand Down
10 changes: 10 additions & 0 deletions activerecord/test/cases/threaded_connections_test.rb
Expand Up @@ -105,5 +105,15 @@ def test_pooled_connection_checkin_two
assert_equal 3, @connection_count
assert_equal 0, @timed_out
end

def test_pooled_connection_checkout_existing_first
ActiveRecord::Base.establish_connection(@connection.merge({:pool => 1}))
conn_pool = ActiveRecord::Base.connection_pool
conn = conn_pool.checkout
conn_pool.checkin(conn)
conn = conn_pool.checkout
assert ActiveRecord::ConnectionAdapters::AbstractAdapter === conn
conn_pool.checkin(conn)
end
end
end

0 comments on commit d7d2d73

Please sign in to comment.