better explicit check for existence of parent
This commit is contained in:
@@ -820,6 +820,10 @@ class Post < ActiveRecord::Base
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def parent_exists?
|
||||
Post.exists?(parent_id)
|
||||
end
|
||||
end
|
||||
|
||||
module DeletionMethods
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if post.parent_id && post.parent %>
|
||||
<% if post.parent_id && post.parent_exists? %>
|
||||
<div class="ui-corner-all ui-state-highlight notice notice-child">
|
||||
<%= has_parent_message(post, @parent_post_set) %>
|
||||
<div id="has-parent-relationship-preview"><%= @parent_post_set.presenter.post_previews_html(self) %></div>
|
||||
|
||||
Reference in New Issue
Block a user