6a91b28932
Gitlab::BackgroundMigration::RedactLinks was prepending EE::Gitlab::BackgroundMigration::RedactLinks, while EE::Gitlab::BackgroundMigration::RedactLinks was trying to include Gitlab::BackgroundMigration::RedactLinks::Redactable. Ruby 2.5.3 failed with an uninitialized constant (https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/118388511).
21 lines
538 B
Ruby
21 lines
538 B
Ruby
# frozen_string_literal: true
|
|
# rubocop:disable Style/Documentation
|
|
|
|
module Gitlab
|
|
module BackgroundMigration
|
|
class RedactLinks
|
|
module Redactable
|
|
extend ActiveSupport::Concern
|
|
|
|
def redact_field!(field)
|
|
self[field].gsub!(%r{/sent_notifications/\h{32}/unsubscribe}, '/sent_notifications/REDACTED/unsubscribe')
|
|
|
|
if self.changed?
|
|
self.update_columns(field => self[field],
|
|
"#{field}_html" => nil)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|