2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-15 20:19:58 -05:00
|
|
|
module Jobs
|
2019-10-02 00:01:53 -04:00
|
|
|
class CleanUpDeprecatedUrlSiteSettings < ::Jobs::Scheduled
|
2018-11-15 20:19:58 -05:00
|
|
|
every 1.day
|
|
|
|
|
|
|
|
def execute(args)
|
2019-10-14 06:03:22 -04:00
|
|
|
::Jobs::MigrateUrlSiteSettings::SETTINGS.each do |old_setting, new_setting|
|
2018-11-15 20:19:58 -05:00
|
|
|
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
|