discourse/db/fixtures/003_flags.rb
Krzysztof Kotlarek 2bb740cb16
FIX: reset cache after flags are seed (#28801)
There was a bug report on meta that after deployment, some topics were not loaded properly for 24 hours - https://meta.discourse.org/t/endless-spinner-on-some-posts/323031/17

In this PR we moved the `like` post action type to the database - https://github.com/discourse/discourse/pull/28362

However, flags are cached for performance reasons https://github.com/discourse/discourse/blob/main/app/serializers/site_serializer.rb#L113

After seed, we should ensure that the cache is reset so the site has access to all post-action types.
2024-09-09 10:40:43 +10:00

79 lines
1.8 KiB
Ruby

# frozen_string_literal: true
Flag.seed do |s|
s.id = 6
s.name = "notify_user"
s.notify_type = false
s.auto_action_type = false
s.require_message = true
s.applies_to = %w[Post Chat::Message]
s.skip_reset_flag_callback = true
end
Flag.seed do |s|
s.id = 3
s.name = "off_topic"
s.notify_type = true
s.auto_action_type = true
s.require_message = false
s.applies_to = %w[Post Chat::Message]
s.skip_reset_flag_callback = true
end
Flag.seed do |s|
s.id = 4
s.name = "inappropriate"
s.notify_type = true
s.auto_action_type = true
s.require_message = false
s.applies_to = %w[Post Topic Chat::Message]
s.skip_reset_flag_callback = true
end
Flag.seed do |s|
s.id = 8
s.name = "spam"
s.notify_type = true
s.auto_action_type = true
s.require_message = false
s.applies_to = %w[Post Topic Chat::Message]
s.skip_reset_flag_callback = true
end
Flag.seed do |s|
s.id = 10
s.name = "illegal"
s.notify_type = true
s.auto_action_type = false
s.require_message = true
s.applies_to = %w[Post Topic Chat::Message]
s.skip_reset_flag_callback = true
end
Flag.seed do |s|
s.id = 7
s.name = "notify_moderators"
s.notify_type = true
s.auto_action_type = false
s.require_message = true
s.applies_to = %w[Post Topic Chat::Message]
s.skip_reset_flag_callback = true
end
Flag.unscoped.seed do |s|
s.id = 9
s.name = "needs_approval"
s.notify_type = false
s.auto_action_type = false
s.require_message = false
s.score_type = true
s.applies_to = %w[]
s.skip_reset_flag_callback = true
end
Flag.unscoped.seed do |s|
s.id = 2
s.name = "like"
s.notify_type = false
s.auto_action_type = false
s.require_message = false
s.score_type = false
s.applies_to = %w[Post]
s.skip_reset_flag_callback = true
end
Flag.reset_flag_settings!