Browse files

Use Array.wrap not Array()

  • Loading branch information...
1 parent fe2f383 commit 41af6d9a78446a5219a321cf638945b1608cefd8 @jeremy jeremy committed Mar 18, 2010
View
3 actionmailer/lib/action_mailer/base.rb
@@ -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 @@ def collect_responses_and_parts_order(headers) #: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 }
View
6 actionmailer/lib/action_mailer/railties/log_subscriber.rb
@@ -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 @@ def logger
end
end
end
-end
+end
View
3 actionpack/lib/action_view/base.rb
@@ -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 @@ def self.xss_safe? #: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)

0 comments on commit 41af6d9

Please sign in to comment.