diff --git a/config/initializers/100-flags.rb b/config/initializers/100-flags.rb new file mode 100644 index 00000000000..4ba3954f0a4 --- /dev/null +++ b/config/initializers/100-flags.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +# On initialize, reset flags cache +Rails.application.config.to_prepare do + if Discourse.cache.is_a?(Cache) && ActiveRecord::Base.connection.table_exists?(:flags) + Flag.reset_flag_settings! + end +end diff --git a/db/fixtures/003_flags.rb b/db/fixtures/003_flags.rb index 008c01b31c0..b905f1fc7a1 100644 --- a/db/fixtures/003_flags.rb +++ b/db/fixtures/003_flags.rb @@ -74,5 +74,3 @@ Flag.unscoped.seed do |s| s.applies_to = %w[Post] s.skip_reset_flag_callback = true end - -Flag.reset_flag_settings!