posts: factor out post edit logic.
Factor out most of the tag edit logic from the Post class to a new PostEdit class. The PostEdit class contains the logic for parsing tags and metatags from the tag edit string, and for determining which tags were added or removed by the edit. Fixes various bugs caused by not calculating the set of added or removed tags correctly, for example when tag category prefixes were used (e.g. `copy:touhou`) or when the same tag was added and removed in the same edit (e.g. `touhou -touhou`). Fixes #5123: Tag categorization prefixes bypass deprecation check Fixes #5126: Negating a deprecated tag will still cause the warning to show Fixes #3477: Remove tag validator triggering on tag category changes Fixes #4848: newpool: metatag doesn't parse correctly
This commit is contained in:
@@ -574,12 +574,6 @@ class PostQueryBuilder
|
||||
end
|
||||
end
|
||||
|
||||
# Parse a tag edit string into a list of strings, one per search term.
|
||||
# @return [Array<String>] the list of terms
|
||||
def parse_tag_edit
|
||||
split_query
|
||||
end
|
||||
|
||||
class_methods do
|
||||
# Parse a simple string value into a Ruby type.
|
||||
# @param string [String] the value to parse
|
||||
|
||||
Reference in New Issue
Block a user