This project is archived and is in readonly mode.
ActionMailer does not return correctly to respond_to? with deliver_ prefix
-
Cyril Mougel
You right, it's because, ActionMailer::Base.respond_to? check only if this string can be used by ActionMailer. Not if it's implemented.
-
Rohit Arondekar
- State changed from new to stale
- Importance changed from to
Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.
-
grosser
- Tag changed from 2.3.4, actionmailer, rails to 2.3.9, actionmailer, rails
still here in 2.3.9
AccountMailer.respond_to?(:deliver_xxx) => #<MatchData "deliver_xxx" 1:"deliver" 2:"xxx"> -
grosser
- Title changed from ActionMailer does not return correctly to respond_to? to ActionMailer does not return correctly to respond_to? with deliver_ prefix
-
Rohit Arondekar
- State changed from stale to open
- Assigned user set to Mikel Lindsaar
grosser, can you work on a patch to fix this? Contributor guide: http://rails.lighthouseapp.com/projects/8994/sending-patches
-
David Trasbo
- Assigned user changed from Mikel Lindsaar to José Valim
Here's a patch that applies to
2-3-stableright now.It doesn't just fix the issue, though. It also greatly simplifies and cleans up the way
ActionMailer::Base.respond_to?andmethod_missingworks by simply checking if we have afooinstance method if we doActionMailer::Base.respond_to?(:deliver_foo)or:create_foo(which gives us the opportunity to remove a bunch of obsolete tests). -
David Trasbo
Here's an improved version.
-
Jeff Kreeftmeijer
- Tag changed from 2.3.9, actionmailer, rails to 2.3.9, actionmailer, patch, rails
-
David Trasbo
- Assigned user changed from José Valim to Santiago Pastorino
-
Santiago Pastorino
- Assigned user changed from Santiago Pastorino to Mikel Lindsaar
-
David Trasbo
Santiago,
I just want to point out that last time I assigned something to Mikel he didn't see it. Plus, this is not a technical change in terms of email - just a minor architectural change.
-
José Valim
- Assigned user changed from Mikel Lindsaar to José Valim
The ticket was assigned to me, why change it in the first place? Please, have patience that I will apply them when I find some time.
-
David Trasbo
Sorry, José. I can see my intent was unclear, but I just wanted to take some load off your shoulders. You seem to have a lot to do at the moment. Again, sorry.
-
José Valim
- State changed from open to wontfix
Instantiating an Action Mailer just to check if it responds to a given method does not look like a good idea to me, so I cannot apply the given patch. You could use instance_methods or public_instance_methods instead.
This is a bug but I am marking it as won't fix since it is on 2-3-stable branch.
-
David Trasbo
So if I changed the patch to use
instance_methodsinstead you wouldn't apply it anyway? -
José Valim
I could apply it.
-
David Trasbo
"Could" is a bit vague, you know.
