Permalink
Browse files

Back out polymorphism from public_supporting_page_path/url helpers

We don't need it (yet), and it makes it difficult to pass in a slug
instead of a SupportingPage instance, which we need to do when
adding a new supporting page to the search index.
  • Loading branch information...
1 parent dbcbf31 commit ea3984f526fda0fcee37981f947354a0bb835064 @tomstuart tomstuart committed Jan 30, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 app/helpers/public_document_routes_helper.rb
@@ -14,14 +14,12 @@ def public_document_url(document, options={})
end
def public_supporting_page_path(document, supporting_page, options = {})
- options.merge!(model_name(document).foreign_key => document.document_identity)
- polymorphic_path([model_name(document), supporting_page], options)
+ policy_supporting_page_path(document.document_identity, supporting_page, options)
end
def public_supporting_page_url(document, supporting_page, options={})
- options.merge!(model_name(document).foreign_key => document.document_identity)
if host = Whitehall.public_host_for(request.host)
- polymorphic_url([model_name(document), supporting_page], options.merge(host: host))
+ policy_supporting_page_url(document.document_identity, supporting_page, options.merge(host: host))
else
public_supporting_page_path(document, supporting_page, options)
end

0 comments on commit ea3984f

Please sign in to comment.