posts/show: refactor parent/child notices.
* Convert notices from helpers to partials. * Eliminate PostSets::PostRelationship class in favor of post_sets/posts template. * Eliminate COUNT(*) queries when calculating the number of child posts. * Eliminate redundant parent load and parent exists queries.
This commit is contained in:
@@ -1239,10 +1239,6 @@ class Post < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def parent_exists?
|
||||
Post.exists?(parent_id)
|
||||
end
|
||||
|
||||
def has_visible_children?
|
||||
return true if has_active_children?
|
||||
return true if has_children? && CurrentUser.user.show_deleted_children?
|
||||
|
||||
Reference in New Issue
Block a user