mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-03 08:18:42 +08:00
We've had this setting off by default in core but enabled on our hosting for a while now, and the upcoming change system is stable and ready for everyone. This commit removes the hidden setting and just makes upcoming changes always on.
27 lines
922 B
Ruby
27 lines
922 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ProblemCheck::UpcomingChangeStableOptedOut < ProblemCheck
|
|
self.perform_every = 1.hour
|
|
self.targets = -> { SiteSetting.upcoming_change_site_settings }
|
|
|
|
def call
|
|
# If the site setting is enabled, then the change is opted in, either
|
|
# manually or automatically, so we skip it.
|
|
return no_problem if SiteSetting.send(target)
|
|
|
|
# Don't care about any changes that are not yet stable, admins can opt
|
|
# in and out of these without worry.
|
|
return no_problem if UpcomingChanges.not_yet_stable?(target)
|
|
|
|
# At this point, we have an upcoming change that is stable or permanent,
|
|
# and the site is opted out of it. Admins need to know that the change
|
|
# will either become permanent or be removed soon.
|
|
problem(target)
|
|
end
|
|
|
|
private
|
|
|
|
def translation_data(upcoming_change)
|
|
{ upcoming_change: SiteSetting.humanized_name(upcoming_change) }
|
|
end
|
|
end
|