compare attr with "id" and self.class.primary_key