fix post archive presenter

This commit is contained in:
r888888888
2017-05-02 15:57:42 -07:00
parent e96e9c0105
commit 9757700ec7
2 changed files with 5 additions and 1 deletions

View File

@@ -105,6 +105,10 @@ class PostArchive < ActiveRecord::Base
end
end
def visible?
post && post.visible?
end
def diff(version = nil)
if post.nil?
latest_tags = tag_array

View File

@@ -36,7 +36,7 @@
<td><%= post_version_diff(post_version) %></td>
<% if CurrentUser.is_member? %>
<td>
<% if post_version.post.visible? %>
<% if post_version.visible? %>
<% if post_version.version != 1 %>
<%= link_to "Undo", undo_post_version_path(post_version), :method => :put, :remote => true %> |
<% end %>