models: set more creator names explicitly.

Set creators explicitly for bans, BURs, comment votes, and posts.
This commit is contained in:
evazion
2020-02-23 02:42:12 -06:00
parent 3a018ee9f7
commit e47d0e0d05
16 changed files with 18 additions and 64 deletions

View File

@@ -13,7 +13,6 @@ class BulkUpdateRequest < ApplicationRecord
validate :script_formatted_correctly
validate :forum_topic_id_not_invalid
validate :validate_script, :on => :create
before_validation :initialize_attributes, :on => :create
before_validation :normalize_text
after_create :create_forum_topic
after_save :update_notice
@@ -173,11 +172,6 @@ class BulkUpdateRequest < ApplicationRecord
lines.join("\n")
end
def initialize_attributes
self.user_id = CurrentUser.user.id unless self.user_id
self.status = "pending"
end
def normalize_text
self.script = script.downcase
end