I really like the idea (truly), but I would try to have a shorter method name and on top of that I would make use of an inoffensive (and more expressive) comment:
defresolvereturnfake_successifuser.nil?result=CreateResetPasswordToken.new(user).call{success: result.success?}endprivate# prevent malicious knowledge about which emails are registereddeffake_success{success: true}end
I think I like this better. In my example with the long method name it still wasn't giving us the full context. It told us that we were concealing which email addresses actually exist - but why? Your example communicates the entire context by talking about "malicious knowledge" and keeps the resolve method readable. Thanks for the reply!
I really like the idea (truly), but I would try to have a shorter method name and on top of that I would make use of an inoffensive (and more expressive) comment:
I think I like this better. In my example with the long method name it still wasn't giving us the full context. It told us that we were concealing which email addresses actually exist - but why? Your example communicates the entire context by talking about "malicious knowledge" and keeps the resolve method readable. Thanks for the reply!
Glad I could help!