mirror of
https://github.com/discourse/discourse.git
synced 2025-01-30 02:36:15 +08:00
DEV: Unify way to reset Site.preloaded_category_custom_fields (#17384)
This commit is contained in:
parent
7b6cd44c32
commit
ee89c68687
|
@ -5,7 +5,11 @@ class Site
|
|||
include ActiveModel::Serialization
|
||||
|
||||
cattr_accessor :preloaded_category_custom_fields
|
||||
self.preloaded_category_custom_fields = Set.new
|
||||
|
||||
def self.reset_preloaded_category_custom_fields
|
||||
self.preloaded_category_custom_fields = Set.new
|
||||
end
|
||||
reset_preloaded_category_custom_fields
|
||||
|
||||
##
|
||||
# Sometimes plugins need to have additional data or options available
|
||||
|
|
|
@ -133,7 +133,7 @@ describe Site do
|
|||
|
||||
expect(categories.last[:custom_fields]["enable_marketplace"]).to eq('f')
|
||||
ensure
|
||||
Site.preloaded_category_custom_fields.clear
|
||||
Site.reset_preloaded_category_custom_fields
|
||||
end
|
||||
|
||||
it 'sets the can_edit field for categories correctly' do
|
||||
|
|
|
@ -34,7 +34,7 @@ describe 'site' do
|
|||
let(:expected_request_schema) { expected_request_schema }
|
||||
end
|
||||
ensure
|
||||
Site.preloaded_category_custom_fields = Set.new
|
||||
Site.reset_preloaded_category_custom_fields
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,7 +25,7 @@ describe SiteSerializer do
|
|||
|
||||
expect(c1[:custom_fields]["enable_marketplace"]).to eq("t")
|
||||
ensure
|
||||
Site.preloaded_category_custom_fields.clear
|
||||
Site.reset_preloaded_category_custom_fields
|
||||
end
|
||||
|
||||
it "includes category tags" do
|
||||
|
|
Loading…
Reference in New Issue
Block a user