replace User model with self.class in generate_token method