hatboysam/sinatra-activerecord-heroku — pull request #2 by ted27 (2014-02-22 21:44:04+00:00)
Title: Add ActiveRecord connection closing logic

Hey, I stumbled upon your example app while searching for information on how to
get rid of the

```ActiveRecord::ConnectionTimeoutError - could not obtain a database connection within 5.000 seconds (waited 5.000 seconds)```

error that happens with Sinatra apps.

There is a simple fix, because connections in the pool are requested and never
released. It is here: http://stackoverflow.com/a/14909075/910723

I think it would be great if your example app contains this snippet so that
people don't end up with this error.

Cheers!