0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 17:53:55 +08:00
discourse/plugins/discourse-topic-voting/db/fixtures/001_badges.rb
David Battersby ee8c1bc3fa
DEV: add upcoming change to enable topic voting badges by default (#41695)
We want to enable the Topic Voting badges by default so that communities
can more easily acknowledge their engaged and contributing members.

For sites that have the Topic Voting plugin enabled — we will show an
upcoming change labelled "Enable Topic Voting Badges".

When the upcoming change is enabled (either manually or via
auto-promotion) we will update all 4 topic voting badges to enabled.
When opting out of this upcoming change we will disable all 4 topic
voting badges.
2026-07-16 18:30:02 +04:00

25 lines
823 B
Ruby
Vendored

# frozen_string_literal: true
[
["Daydreamer", BadgeType::Bronze, 1, false],
["Brainstormer", BadgeType::Silver, 5, true],
["Innovator", BadgeType::Silver, 15, true],
["Visionary", BadgeType::Gold, 25, true],
].each do |name, level, count, allow_title|
Badge.seed(:name) do |badge|
badge.name = name
badge.default_icon = "vote-up-filled"
badge.badge_type_id = level
badge.default_badge_grouping_id = BadgeGrouping::Community
badge.query = DiscourseTopicVoting::BadgeQueries.for_threshold(count)
badge.listable = true
badge.target_posts = true
badge.multiple_grant = true
badge.default_enabled = true
badge.default_allow_title = allow_title
badge.trigger = Badge::Trigger::None
badge.auto_revoke = true
badge.show_posts = true
badge.system = true
end
end