mirror of
https://github.com/discourse/discourse.git
synced 2025-04-11 10:20:55 +08:00
FIX: Error condition in SidebarSiteSettingsBackfiller (#19787)
This commit is contained in:
parent
72318a30ec
commit
673089a6b4
@ -84,6 +84,8 @@ class SidebarSiteSettingsBackfiller
|
|||||||
SQL
|
SQL
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return 0 if select_statements.blank?
|
||||||
|
|
||||||
DB.query_single(<<~SQL)[0]
|
DB.query_single(<<~SQL)[0]
|
||||||
SELECT
|
SELECT
|
||||||
COUNT(*)
|
COUNT(*)
|
||||||
|
@ -226,6 +226,16 @@ RSpec.describe SidebarSiteSettingsBackfiller do
|
|||||||
|
|
||||||
expect(backfiller.number_of_users_to_backfill).to eq(3)
|
expect(backfiller.number_of_users_to_backfill).to eq(3)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "returns 0 for the user count when no new category is added or removed" do
|
||||||
|
backfiller = described_class.new(
|
||||||
|
"default_sidebar_categories",
|
||||||
|
previous_value: "",
|
||||||
|
new_value: ""
|
||||||
|
)
|
||||||
|
|
||||||
|
expect(backfiller.number_of_users_to_backfill).to eq(0)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'for default_sidebar_tags setting' do
|
context 'for default_sidebar_tags setting' do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user