Retrieve connection through Apartment module

In some places the connection and connection related things were being accessed directly through `ActiveRecord::Base` instead of `Apartment.connection_class`.