Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Allow String as delivery method #457

Closed
wants to merge 1 commit into from

3 participants

@skyeagle

I have an issue refers to this limitation when my configuration yaml is generating by chef (JSON => Hash => YAML). JSON is not allowing to use symbols.

@radar radar commented on the diff
lib/mail/configuration.rb
@@ -26,7 +26,7 @@ def delivery_method(method = nil, settings = {})
end
def lookup_delivery_method(method)
- case method
+ case method.is_a?(String) ? method.to_sym : method
@radar
radar added a note

I think this would just be better as case method.to_sym.

@radar
radar added a note

Actually, I'm wrong. This can support nil values as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@radar

I have merged this commit, with some tests, into my fork: radar/mail@2691f5c

@mikel
Owner

@radar can you open a new PR off your fork? Or have you already?

@mikel
Owner

@radar Please link to the new PR from here so I know to close both.

@mikel mikel closed this pull request from a commit
@skyeagle skyeagle Allow string as delivery_method
Fixes #457
2b79ba9
@mikel mikel closed this in 2b79ba9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 15, 2012
  1. @skyeagle
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/mail/configuration.rb
View
2  lib/mail/configuration.rb
@@ -26,7 +26,7 @@ def delivery_method(method = nil, settings = {})
end
def lookup_delivery_method(method)
- case method
+ case method.is_a?(String) ? method.to_sym : method
@radar
radar added a note

I think this would just be better as case method.to_sym.

@radar
radar added a note

Actually, I'm wrong. This can support nil values as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
when nil
Mail::SMTP
when :smtp
Something went wrong with that request. Please try again.