'The ranking logic, for sorting aggregated activities'

def rank(self, aggregated_activities):

    aggregated_activities.sort(key=(lambda a: a.updated_at), reverse=True)
    return aggregated_activities
