Permalink
Browse files

Ensure resolvers backward compatibility.

  • Loading branch information...
1 parent 8e6d276 commit d3f7e565d1a6ee15605971c3f3fea6e756a1ff99 @josevalim josevalim committed Dec 9, 2010
View
2 actionpack/lib/action_view/lookup_context.rb
@@ -109,7 +109,7 @@ def with_fallbacks
def args_for_lookup(name, prefix, partial, keys) #:nodoc:
name, prefix = normalize_name(name, prefix)
- [name, prefix, partial || false, @details, keys, details_key]
+ [name, prefix, partial || false, @details, details_key, keys]
end
# Support legacy foo.erb names even though we now ignore .erb
View
6 actionpack/lib/action_view/path_set.rb
@@ -10,10 +10,8 @@ def #{method}(*args)
METHOD
end
- def find(path, prefix = nil, partial = false, details = {}, keys = [], key = nil)
- template = find_all(path, prefix, partial, details, keys, key).first
- raise MissingTemplate.new(self, "#{prefix}/#{path}", details, partial) unless template
- template
+ def find(*args)
+ find_all(*args).first || raise(MissingTemplate.new(self, "#{args[1]}/#{args[0]}", args[3], args[2]))
end
def find_all(*args)
View
2 actionpack/lib/action_view/template/resolver.rb
@@ -15,7 +15,7 @@ def clear_cache
end
# Normalizes the arguments and passes it on to find_template.
- def find_all(name, prefix=nil, partial=false, details={}, locals=[], key=nil)
+ def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[])
cached(key, [name, prefix, partial], details, locals) do
find_templates(name, prefix, partial, details)
end

0 comments on commit d3f7e56

Please sign in to comment.