FIX: Remove site settings override for deprecated url site settings.

This commit is contained in:
Guo Xiang Tan 2018-11-20 11:42:39 +08:00
parent e25b3965a7
commit 81b3bdaabd
2 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@ module Jobs
Jobs::MigrateUrlSiteSettings::SETTINGS.each do |old_setting, new_setting|
if SiteSetting.where("name = ? AND value IS NOT NULL", new_setting).exists?
SiteSetting.public_send("#{old_setting}=", nil, warn: false)
SiteSetting.find_by(name: old_setting).destroy!
end
end
end

View File

@ -21,6 +21,7 @@ RSpec.describe Jobs::CleanUpDeprecatedUrlSiteSettings do
described_class.new.execute({})
end.to change { SiteSetting.logo_url }.from("/test/some/url").to("")
expect(SiteSetting.exists?(name: "logo_url")).to eq(false)
expect(SiteSetting.logo).to eq(logo_upload)
expect(SiteSetting.logo_small_url).to eq('/test/another/url')
end