FIX: Rename deprecated icons, allow custom icons in badges

- adds a migration renaming FA4 icon names in badges
- allows all icons to be used in badges (previously was limited to icons prefixed with fa-)
- renames remaining FA 4.7 icons equivalents
This commit is contained in:
Penar Musaraj
2019-07-16 11:13:44 -04:00
committed by GitHub
parent ed5b31f427
commit a571efba35
16 changed files with 33 additions and 22 deletions

View File

@ -270,7 +270,7 @@ end
Badge.seed do |b|
b.id = Badge::Anniversary
b.name = "Anniversary"
b.default_icon = "fa-clock-o"
b.default_icon = "far-clock"
b.badge_type_id = BadgeType::Silver
b.default_badge_grouping_id = BadgeGrouping::Community
b.query = nil
@ -427,7 +427,7 @@ end
Badge.seed do |b|
b.id = id
b.name = name
b.default_icon = "fa-eye"
b.default_icon = "far-eye"
b.badge_type_id = level
b.query = BadgeQueries.consecutive_visits(days)
b.default_badge_grouping_id = BadgeGrouping::Community

View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
class RenameDeprecatedBadgeIcons < ActiveRecord::Migration[5.2]
def up
execute "UPDATE badges SET icon = 'far-clock' WHERE icon = 'fa-clock-o'"
execute "UPDATE badges SET icon = 'far-eye' WHERE icon = 'fa-eye'"
end
def down
end
end