2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-05-24 01:50:20 -04:00
|
|
|
Badge.where(name: "Complete New User Track").update_all(
|
|
|
|
name: DiscourseNarrativeBot::NewUserNarrative::BADGE_NAME,
|
|
|
|
)
|
|
|
|
|
|
|
|
Badge.where(name: "Complete Discobot Advanced User Track").update_all(
|
|
|
|
name: DiscourseNarrativeBot::AdvancedUserNarrative::BADGE_NAME,
|
|
|
|
)
|
|
|
|
|
|
|
|
new_user_narrative_badge = Badge.find_by(name: DiscourseNarrativeBot::NewUserNarrative::BADGE_NAME)
|
|
|
|
|
|
|
|
unless new_user_narrative_badge
|
|
|
|
new_user_narrative_badge =
|
2023-02-27 21:42:05 -05:00
|
|
|
Badge.create!(
|
|
|
|
name: DiscourseNarrativeBot::NewUserNarrative::BADGE_NAME,
|
|
|
|
badge_type_id: 3,
|
|
|
|
icon: "stamp",
|
|
|
|
)
|
2017-05-24 01:50:20 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
advanced_user_narrative_badge =
|
|
|
|
Badge.find_by(name: DiscourseNarrativeBot::AdvancedUserNarrative::BADGE_NAME)
|
|
|
|
|
|
|
|
unless advanced_user_narrative_badge
|
|
|
|
advanced_user_narrative_badge =
|
2023-02-27 21:42:05 -05:00
|
|
|
Badge.create!(
|
|
|
|
name: DiscourseNarrativeBot::AdvancedUserNarrative::BADGE_NAME,
|
|
|
|
badge_type_id: 2,
|
|
|
|
icon: "stamp",
|
|
|
|
)
|
2017-05-24 01:50:20 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
badge_grouping = BadgeGrouping.find(1)
|
|
|
|
|
|
|
|
[
|
|
|
|
[new_user_narrative_badge, I18n.t("badges.certified.description")],
|
|
|
|
[advanced_user_narrative_badge, I18n.t("badges.licensed.description")],
|
|
|
|
].each do |badge, description|
|
2023-02-27 21:42:05 -05:00
|
|
|
badge.update!(
|
|
|
|
badge_grouping: badge_grouping,
|
|
|
|
description: description,
|
|
|
|
system: true,
|
|
|
|
icon: "stamp",
|
|
|
|
)
|
2017-05-24 01:50:20 -04:00
|
|
|
end
|