Use Kernel#Array instead of Array.wrap in view_paths

This commit is contained in:
Rafael Mendonça França 2012-01-05 17:08:18 -03:00
parent 1a163dcc41
commit ec28c4fb24
3 changed files with 3 additions and 4 deletions

View File

@ -89,7 +89,7 @@ module AbstractController
# * <tt>paths</tt> - If a PathSet is provided, use that;
# otherwise, process the parameter into a PathSet.
def view_paths=(paths)
self._view_paths = ActionView::PathSet.new(Array.wrap(paths))
self._view_paths = ActionView::PathSet.new(Array(paths))
end
end
end

View File

@ -1,7 +1,6 @@
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'
require 'active_support/ordered_options'
require 'action_view/log_subscriber'
require 'active_support/core_ext/module/deprecation'
@ -160,7 +159,7 @@ module ActionView #:nodoc:
def process_view_paths(value)
value.is_a?(PathSet) ?
value.dup : ActionView::PathSet.new(Array.wrap(value))
value.dup : ActionView::PathSet.new(Array(value))
end
deprecate :process_view_paths

View File

@ -102,7 +102,7 @@ module ActionView
# Whenever setting view paths, makes a copy so we can manipulate then in
# instance objects as we wish.
def view_paths=(paths)
@view_paths = ActionView::PathSet.new(Array.wrap(paths))
@view_paths = ActionView::PathSet.new(Array(paths))
end
def find(name, prefixes = [], partial = false, keys = [], options = {})