discourse/app/services/problem_check/upcoming_change_stable_opted_out.rb
Martin Brennan a15f83133a
DEV: Remove enable_upcoming_changes global setting gate (#38360)
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.
2026-03-10 10:08:20 +10:00

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