mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use Array.wrap not Array()
This commit is contained in:
parent
fe2f383cf3
commit
41af6d9a78
3 changed files with 8 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
require 'mail'
|
||||
require 'action_mailer/tmail_compat'
|
||||
require 'action_mailer/collector'
|
||||
require 'active_support/core_ext/array/wrap'
|
||||
|
||||
module ActionMailer #:nodoc:
|
||||
# Action Mailer allows you to send email from your application using a mailer model and views.
|
||||
|
@ -615,7 +616,7 @@ module ActionMailer #:nodoc:
|
|||
end
|
||||
|
||||
def each_template(paths, name, &block) #:nodoc:
|
||||
Array(paths).each do |path|
|
||||
Array.wrap(paths).each do |path|
|
||||
templates = lookup_context.find_all(name, path)
|
||||
templates = templates.uniq_by { |t| t.formats }
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
require 'active_support/core_ext/array/wrap'
|
||||
|
||||
module ActionMailer
|
||||
module Railties
|
||||
class LogSubscriber < Rails::LogSubscriber
|
||||
def deliver(event)
|
||||
recipients = Array(event.payload[:to]).join(', ')
|
||||
recipients = Array.wrap(event.payload[:to]).join(', ')
|
||||
info("\nSent mail to #{recipients} (%1.fms)" % event.duration)
|
||||
debug(event.payload[:mail])
|
||||
end
|
||||
|
@ -17,4 +19,4 @@ module ActionMailer
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'active_support/core_ext/module/attr_internal'
|
||||
require 'active_support/core_ext/module/delegation'
|
||||
require 'active_support/core_ext/class/attribute'
|
||||
require 'active_support/core_ext/array/wrap'
|
||||
|
||||
module ActionView #:nodoc:
|
||||
class NonConcattingString < ActiveSupport::SafeBuffer
|
||||
|
@ -216,7 +217,7 @@ module ActionView #:nodoc:
|
|||
end
|
||||
|
||||
def self.process_view_paths(value)
|
||||
ActionView::PathSet.new(Array(value))
|
||||
ActionView::PathSet.new(Array.wrap(value))
|
||||
end
|
||||
|
||||
def self.for_controller(controller)
|
||||
|
|
Loading…
Reference in a new issue