diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2010-03-17 22:27:48 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-03-17 22:27:48 -0700 |
commit | 41af6d9a78446a5219a321cf638945b1608cefd8 (patch) | |
tree | 95a5e284c6504e28802aa3a8168a8b7cc450a0e5 | |
parent | fe2f383cf3c0aa6901487c398b9ae8ffce03ecbd (diff) | |
download | rails-41af6d9a78446a5219a321cf638945b1608cefd8.tar.gz rails-41af6d9a78446a5219a321cf638945b1608cefd8.tar.bz2 rails-41af6d9a78446a5219a321cf638945b1608cefd8.zip |
Use Array.wrap not Array()
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 3 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/railties/log_subscriber.rb | 6 | ||||
-rw-r--r-- | actionpack/lib/action_view/base.rb | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index f94e23fe05..0823120fc8 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/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 @@ 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 } diff --git a/actionmailer/lib/action_mailer/railties/log_subscriber.rb b/actionmailer/lib/action_mailer/railties/log_subscriber.rb index d1b3dd33af..af76d807d0 100644 --- a/actionmailer/lib/action_mailer/railties/log_subscriber.rb +++ b/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 @@ module ActionMailer end end end -end
\ No newline at end of file +end diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 4d9f53cf95..859c5c0863 100644 --- a/actionpack/lib/action_view/base.rb +++ b/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 @@ 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) |