Automatic reconnection for Postgres
Add this line to your application's Gemfile:
gem 'active_record-pg_reconnect'
And then execute:
$ bundle
Or install it yourself as:
$ gem install active_record-pg_reconnect
Bug reports and pull requests are welcome on GitHub at https://github.com/gabynaiman/active_record-pg_reconnect.
The gem is available as open source under the terms of the MIT License.