2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-15 20:19:58 -05:00
|
|
|
module Jobs
|
|
|
|
class CleanUpDeprecatedUrlSiteSettings < Jobs::Scheduled
|
|
|
|
every 1.day
|
|
|
|
|
|
|
|
def execute(args)
|
|
|
|
Jobs::MigrateUrlSiteSettings::SETTINGS.each do |old_setting, new_setting|
|
|
|
|
if SiteSetting.where("name = ? AND value IS NOT NULL", new_setting).exists?
|
2019-05-06 21:00:09 -04:00
|
|
|
SiteSetting.set(old_setting, nil, warn: false)
|
2018-11-19 22:42:39 -05:00
|
|
|
SiteSetting.find_by(name: old_setting).destroy!
|
2018-11-15 20:19:58 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|