From af9c1b0acf781b0f20af02291a07c28c53c44e25 Mon Sep 17 00:00:00 2001 From: Toks Date: Wed, 4 Jun 2014 14:11:20 -0400 Subject: [PATCH] Fix bug where has_active_children wasn't updated on post deletion/undeletion --- app/models/post.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/post.rb b/app/models/post.rb index 77755829b..8274b57a7 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -910,7 +910,7 @@ class Post < ActiveRecord::Base def update_parent_on_save if parent_id == parent_id_was - # do nothing + Post.update_has_children_flag_for(parent_id) elsif !parent_id_was.nil? Post.update_has_children_flag_for(parent_id) Post.update_has_children_flag_for(parent_id_was) @@ -986,6 +986,7 @@ class Post < ActiveRecord::Base update_column(:is_flagged, false) update_column(:is_banned, true) if options[:ban] || has_tag?("banned_artist") give_favorites_to_parent if options[:move_favorites] + update_parent_on_save unless options[:without_mod_action]