DEV: Remove `PostProcessed` trigger option (#13916)
It was deprecated 5 years ago in e55e2aff94
I've seen it still being used in the wild, even though it doesn't do anything anymore as I understand it.
This commit is contained in:
parent
fbd1cd5fe1
commit
07c6b720bc
|
@ -75,11 +75,10 @@ class Badge < ActiveRecord::Base
|
||||||
attr_accessor :has_badge
|
attr_accessor :has_badge
|
||||||
|
|
||||||
def self.trigger_hash
|
def self.trigger_hash
|
||||||
Hash[*(
|
@trigger_hash ||= Badge::Trigger.constants.map do |k|
|
||||||
Badge::Trigger.constants.map { |k|
|
name = k.to_s.underscore
|
||||||
[k.to_s.underscore, Badge::Trigger.const_get(k)]
|
[name, Badge::Trigger.const_get(k)] unless name =~ /deprecated/
|
||||||
}.flatten
|
end.compact.to_h
|
||||||
)]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module Trigger
|
module Trigger
|
||||||
|
@ -88,7 +87,7 @@ class Badge < ActiveRecord::Base
|
||||||
PostRevision = 2
|
PostRevision = 2
|
||||||
TrustLevelChange = 4
|
TrustLevelChange = 4
|
||||||
UserChange = 8
|
UserChange = 8
|
||||||
PostProcessed = 16 # deprecated
|
DeprecatedPostProcessed = 16 # No longer in use
|
||||||
|
|
||||||
def self.is_none?(trigger)
|
def self.is_none?(trigger)
|
||||||
[None].include? trigger
|
[None].include? trigger
|
||||||
|
|
|
@ -5221,7 +5221,6 @@ en:
|
||||||
post_revision: "When a user edits or creates a post"
|
post_revision: "When a user edits or creates a post"
|
||||||
trust_level_change: "When a user changes trust level"
|
trust_level_change: "When a user changes trust level"
|
||||||
user_change: "When a user is edited or created"
|
user_change: "When a user is edited or created"
|
||||||
post_processed: "After a post is processed"
|
|
||||||
preview:
|
preview:
|
||||||
link_text: "Preview granted badges"
|
link_text: "Preview granted badges"
|
||||||
plan_text: "Preview with query plan"
|
plan_text: "Preview with query plan"
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class RemovePostProcessedTriggerOption < ActiveRecord::Migration[6.1]
|
||||||
|
def up
|
||||||
|
# Replace Badge::Trigger::PostProcessed (16) with None (0)
|
||||||
|
DB.exec("UPDATE badges SET trigger = 0 WHERE trigger = 16")
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
raise ActiveRecord::IrreversibleMigration
|
||||||
|
end
|
||||||
|
end
|
|
@ -198,9 +198,6 @@
|
||||||
"trust_level_change": {
|
"trust_level_change": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"post_processed": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"post_action": {
|
"post_action": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
}
|
}
|
||||||
|
@ -210,7 +207,6 @@
|
||||||
"none",
|
"none",
|
||||||
"post_revision",
|
"post_revision",
|
||||||
"trust_level_change",
|
"trust_level_change",
|
||||||
"post_processed",
|
|
||||||
"post_action"
|
"post_action"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue