diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-08 03:35:14 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-08 03:35:14 -0700 |
commit | 843cab6f98e2d6c99bc913bd2aade6c848e4ce8d (patch) | |
tree | 3725e7e1a0575c59476c8e35d5b0cbe7fd5aa1a3 /actionpack/lib/action_view | |
parent | 30db3a82f653e7d7215e41bec525932cf5b17de1 (diff) | |
parent | 06671c37de93702323ee281aedc4023bb8d7cdb6 (diff) | |
download | rails-843cab6f98e2d6c99bc913bd2aade6c848e4ce8d.tar.gz rails-843cab6f98e2d6c99bc913bd2aade6c848e4ce8d.tar.bz2 rails-843cab6f98e2d6c99bc913bd2aade6c848e4ce8d.zip |
Merge pull request #420 from burke/master
Accept single prefix in ActionView::MissingTemplate#initialize
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/path_set.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_view/template/error.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/path_set.rb b/actionpack/lib/action_view/path_set.rb index 8b840a6463..54b9a6d39e 100644 --- a/actionpack/lib/action_view/path_set.rb +++ b/actionpack/lib/action_view/path_set.rb @@ -1,3 +1,5 @@ +require "active_support/core_ext/array/wrap" + module ActionView #:nodoc: # = Action View PathSet class PathSet < Array #:nodoc: @@ -15,7 +17,7 @@ module ActionView #:nodoc: end def find_all(path, prefixes = [], *args) - prefixes = [prefixes] if String === prefixes + prefixes = Array.wrap(prefixes) prefixes.each do |prefix| each do |resolver| templates = resolver.find_all(path, prefix, *args) diff --git a/actionpack/lib/action_view/template/error.rb b/actionpack/lib/action_view/template/error.rb index e246646963..d4448a7b33 100644 --- a/actionpack/lib/action_view/template/error.rb +++ b/actionpack/lib/action_view/template/error.rb @@ -1,3 +1,4 @@ +require "active_support/core_ext/array/wrap" require "active_support/core_ext/enumerable" module ActionView @@ -29,6 +30,7 @@ module ActionView def initialize(paths, path, prefixes, partial, details, *) @path = path + prefixes = Array.wrap(prefixes) display_paths = paths.compact.map{ |p| p.to_s.inspect }.join(", ") template_type = if partial "partial" |