Access connection via class due to a DEPRECATION by rails 4