ActiveRecord::Relation select problem

All klass.connection and @klass.connection are now just connection, which is delegated to klass. Tests are passing. find_by_sql and count_by_sql are AR::Relation methods.

This should fully fix #6331.

This patch will also give an opportunity to implement something like:

Post.connection(external_database).all