This project is archived and is in readonly mode.
Bug(?) - ActionMailer responds_to? failing to return true/false bug
-
Frederick Cheung
- Tag changed from 2.3.2, actionmailer, base, rails, respond_to to 2.3.2, actionmailer, base, rails, respond_to
Does it really matter? ruby will happily consider anything other than nil/false as true for the purposes of an if statement and so on.
-
PommyTom
Hi Frederick,
Yeah, that would be fine normally, as it responds with true just for having a value. But the problem with this instance as described above, it is returning a object for any values that start with the dynamic method starts (such as deliver... or create...) so with a matchdata being returned it will always return true even though the method doesn't actually exist (matchdata also returned when the method does exist such as deliver_test_email in the example above).
Any other info you require, please let me know.
Best regards,
Tom
-
Frederick Cheung
Ah, I'm with you now, it's not actually checking whether foo exists when handling respond_to 'deliver_foo'
-
Santiago Pastorino
- State changed from new to open
- Tag changed from 2.3.2, actionmailer, base, rails, respond_to to 232, actionmailer, base, rails, respond_to
- Importance changed from to
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale