Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
3438f6ca
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3438f6ca
编写于
1月 05, 2012
作者:
R
Rafael Mendonça França
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Array.wrap is no longer needed here
上级
d2a69080
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
11 deletion
+8
-11
actionmailer/lib/action_mailer/base.rb
actionmailer/lib/action_mailer/base.rb
+6
-7
actionmailer/lib/action_mailer/log_subscriber.rb
actionmailer/lib/action_mailer/log_subscriber.rb
+2
-4
未找到文件。
actionmailer/lib/action_mailer/base.rb
浏览文件 @
3438f6ca
require
'mail'
require
'action_mailer/collector'
require
'active_support/core_ext/array/wrap'
require
'active_support/core_ext/object/blank'
require
'active_support/core_ext/proc'
require
'active_support/core_ext/string/inflections'
...
...
@@ -122,8 +121,8 @@ module ActionMailer #:nodoc:
#
# <%= users_url(:host => "example.com") %>
#
# You should use the <tt>named_route_url</tt> style (which generates absolute URLs) and avoid using the
# <tt>named_route_path</tt> style (which generates relative URLs), since clients reading the mail will
# You should use the <tt>named_route_url</tt> style (which generates absolute URLs) and avoid using the
# <tt>named_route_path</tt> style (which generates relative URLs), since clients reading the mail will
# have no concept of a current URL from which to determine a relative path.
#
# It is also possible to set a default host that will be used in all mailers by setting the <tt>:host</tt>
...
...
@@ -132,7 +131,7 @@ module ActionMailer #:nodoc:
# config.action_mailer.default_url_options = { :host => "example.com" }
#
# When you decide to set a default <tt>:host</tt> for your mailers, then you need to make sure to use the
# <tt>:only_path => false</tt> option when using <tt>url_for</tt>. Since the <tt>url_for</tt> view helper
# <tt>:only_path => false</tt> option when using <tt>url_for</tt>. Since the <tt>url_for</tt> view helper
# will generate relative URLs by default when a <tt>:host</tt> option isn't explicitly provided, passing
# <tt>:only_path => false</tt> will ensure that absolute URLs are generated.
#
...
...
@@ -149,8 +148,8 @@ module ActionMailer #:nodoc:
#
# = Multipart Emails
#
# Multipart messages can also be used implicitly because Action Mailer will automatically detect and use
# multipart templates, where each template is named after the name of the action, followed by the content
# Multipart messages can also be used implicitly because Action Mailer will automatically detect and use
# multipart templates, where each template is named after the name of the action, followed by the content
# type. Each such detected template will be added as a separate part to the message.
#
# For example, if the following templates exist:
...
...
@@ -707,7 +706,7 @@ def collect_responses_and_parts_order(headers) #:nodoc:
end
def
each_template
(
paths
,
name
,
&
block
)
#:nodoc:
templates
=
lookup_context
.
find_all
(
name
,
Array
.
wrap
(
paths
))
templates
=
lookup_context
.
find_all
(
name
,
Array
(
paths
))
templates
.
uniq
{
|
t
|
t
.
formats
}.
each
(
&
block
)
end
...
...
actionmailer/lib/action_mailer/log_subscriber.rb
浏览文件 @
3438f6ca
require
'active_support/core_ext/array/wrap'
module
ActionMailer
class
LogSubscriber
<
ActiveSupport
::
LogSubscriber
def
deliver
(
event
)
recipients
=
Array
.
wrap
(
event
.
payload
[
:to
]).
join
(
', '
)
recipients
=
Array
(
event
.
payload
[
:to
]).
join
(
', '
)
info
(
"
\n
Sent mail to
#{
recipients
}
(%1.fms)"
%
event
.
duration
)
debug
(
event
.
payload
[
:mail
])
end
...
...
@@ -19,4 +17,4 @@ def logger
end
end
ActionMailer
::
LogSubscriber
.
attach_to
:action_mailer
\ No newline at end of file
ActionMailer
::
LogSubscriber
.
attach_to
:action_mailer
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录