This commit is contained in:
Toks
2013-12-06 14:25:24 -05:00
parent 77a7da3f65
commit 0842d9dc6f
2 changed files with 7 additions and 2 deletions

View File

@@ -34,7 +34,7 @@
}
} else if (command === "[reset]") {
return [];
} else if (command[0] === "-" && !command.match(/^-pool:/i)) {
} else if (command[0] === "-" && !command.match(/^(?:-pool|-parent):/i)) {
return Danbooru.reject(tags, function(x) {return x === command.substr(1, 100)});
} else {
tags.push(command);

View File

@@ -432,7 +432,7 @@ class Post < ActiveRecord::Base
end
def filter_metatags(tags)
@pre_metatags, tags = tags.partition {|x| x =~ /\A(?:rating|parent):/i}
@pre_metatags, tags = tags.partition {|x| x =~ /\A(?:rating|parent|-parent):/i}
@post_metatags, tags = tags.partition {|x| x =~ /\A(?:-pool|pool|newpool|fav|child):/i}
apply_pre_metatags
return tags
@@ -485,6 +485,11 @@ class Post < ActiveRecord::Base
when /^parent:none$/i, /^parent:0$/i
self.parent_id = nil
when /^-parent:(\d+)$/i
if parent_id == $1.to_i
self.parent_id = nil
end
when /^parent:(\d+)$/i
if $1.to_i != id && Post.exists?(["id = ?", $1.to_i])
self.parent_id = $1.to_i