How to get the underlying database connection outOverview
Problem: you want to get at the underlying database connection object, e.g. so you can do something like create_function or create_aggregate on a SQLite database. You try ActiveRecord::Base.connection but that just gives you the Rails connection adapter, not the underlying database connection.
NEW
Fixed some bugs.
How to get the underlying database connection outInformation