Update ancestors method to rails4