Fix undo not undoing parent additions

This commit is contained in:
Toks
2013-08-13 13:03:48 -04:00
parent 069eabaaef
commit d4060a647d

View File

@@ -121,6 +121,8 @@ class PostVersion < ActiveRecord::Base
added.each do |tag|
if tag =~ /^source:/
post.source = ""
elsif tag =~ /^parent:/
post.parent_id = nil
else
escaped_tag = Regexp.escape(tag)
post.tag_string = post.tag_string.sub(/(?:\A| )#{escaped_tag}(?:\Z| )/, " ").strip