From 12c27aec9d50dc9730feec24126886c4b5174929 Mon Sep 17 00:00:00 2001 From: Toks Date: Thu, 28 Mar 2013 19:27:44 -0400 Subject: [PATCH] proper fix for #725 show all antecedent implications on wiki instead of just the first --- app/presenters/wiki_page_presenter.rb | 4 ++-- app/views/wiki_pages/show.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/presenters/wiki_page_presenter.rb b/app/presenters/wiki_page_presenter.rb index 723127142..6137e06c3 100644 --- a/app/presenters/wiki_page_presenter.rb +++ b/app/presenters/wiki_page_presenter.rb @@ -25,8 +25,8 @@ class WikiPagePresenter @consequent_tag_implications ||= TagImplication.where("status = 'active' and consequent_name = ?", wiki_page.title).all end - def antecedent_tag_implication - @antecedent_tag_implication ||= TagImplication.where("status = 'active' and antecedent_name = ?", wiki_page.title).first + def antecedent_tag_implications + @antecedent_tag_implications ||= TagImplication.where("status = 'active' and antecedent_name = ?", wiki_page.title).all end # Produce a formatted page that shows the difference between two versions of a page. diff --git a/app/views/wiki_pages/show.html.erb b/app/views/wiki_pages/show.html.erb index 7c5bc4907..96f832bd4 100644 --- a/app/views/wiki_pages/show.html.erb +++ b/app/views/wiki_pages/show.html.erb @@ -23,8 +23,8 @@

The following tags are aliased to this tag: <%= raw @wiki_page.presenter.consequent_tag_aliases.map {|x| link_to(x.antecedent_name, posts_path(:tags => x.antecedent_name))}.join(", ") %>.

<% end %> - <% if @wiki_page.presenter.antecedent_tag_implication %> -

This tag has been implicated to <%= link_to @wiki_page.presenter.antecedent_tag_implication.consequent_name, posts_path(:tags => @wiki_page.presenter.antecedent_tag_implication.consequent_name) %>.

+ <% if @wiki_page.presenter.antecedent_tag_implications %> +

This tag has been implicated to <%= raw @wiki_page.presenter.antecedent_tag_implications.map {|x| link_to(x.consequent_name, posts_path(:tags => x.consequent_name))}.join(", ") %>.

<% end %> <% if @wiki_page.presenter.consequent_tag_implications.any? %>