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`.
I'm not sure if the change here is OK. I tested locally and on staging with rails 4.1.8 and postgres and everything worked fine.