Skip to content

Commit

Permalink
check the arity of #document_partial_name before calling the new 2-ar…
Browse files Browse the repository at this point in the history
…g form
  • Loading branch information
cbeer committed Mar 12, 2014
1 parent 0954083 commit 54f2b36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/helpers/blacklight/blacklight_helper_behavior.rb
Expand Up @@ -472,7 +472,11 @@ def render_document_partials(doc, partials = [], locals ={})
# @param [String] base name for the partial
# @param [Hash] locales to pass through to the partials
def render_document_partial(doc, base_name, locals = {})
format = document_partial_name(doc, base_name)
format = if method(:document_partial_name).arity == 1
document_partial_name(doc)
else
document_partial_name(doc, base_name)
end

document_partial_path_templates.each do |str|
# XXX rather than handling this logic through exceptions, maybe there's a Rails internals method
Expand Down

0 comments on commit 54f2b36

Please sign in to comment.