BURs: fix normalization of uppercase characters in scripts.

Only downcase tags in aliases, implications, and category change
commands. Don't downcase mass update commands. Mass updates are
potentially case sensitive (for example: `mass update source:imageboard -> source:Imageboard`).
This commit is contained in:
evazion
2020-08-24 17:54:53 -05:00
parent 1ddcc661e1
commit d9085877be
3 changed files with 25 additions and 14 deletions

View File

@@ -8,7 +8,6 @@ class BulkUpdateRequest < ApplicationRecord
belongs_to :forum_post, optional: true
belongs_to :approver, optional: true, class_name: "User"
before_validation :normalize_text
validates_presence_of :reason, on: :create
validates_presence_of :script
validates_presence_of :title, if: ->(rec) {rec.forum_topic_id.blank?}
@@ -117,10 +116,6 @@ class BulkUpdateRequest < ApplicationRecord
extend SearchMethods
include ApprovalMethods
def normalize_text
self.script = script.downcase
end
def update_tags
self.tags = processor.affected_tags
end