connection is depricated in rails4, use self.class.connection instead