From 160d2a47aa1af5ba2bb77d59c3ad05a6e49d3b27 Mon Sep 17 00:00:00 2001 From: Type-kun Date: Mon, 9 Jan 2017 15:53:58 +0500 Subject: [PATCH] Fixes #2758 --- app/models/post.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/post.rb b/app/models/post.rb index 558fab286..a679c0fce 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -1328,6 +1328,12 @@ class Post < ActiveRecord::Base def has_visible_children has_visible_children? end + + def children_ids + if has_children? + children.map{|p| p.id}.join(' ') + end + end end module DeletionMethods @@ -1512,7 +1518,7 @@ class Post < ActiveRecord::Base end def method_attributes - list = super + [:uploader_name, :has_large, :tag_string_artist, :tag_string_character, :tag_string_copyright, :tag_string_general, :has_visible_children] + list = super + [:uploader_name, :has_large, :tag_string_artist, :tag_string_character, :tag_string_copyright, :tag_string_general, :has_visible_children, :children_ids] if visible? list += [:file_url, :large_file_url, :preview_file_url] end