FIX: Badges appeared in wrong badge group

Some badges always appeared in the "Other" group (the default group) and some badges were always moved back into the original group during seeding.

Now badges are either in the correct, seeded group or stay in a custom group if the admin moved the badge into a custom group.
This commit is contained in:
Gerhard Schlager
2019-01-21 19:21:55 +01:00
parent 5218702702
commit d82628987a
2 changed files with 2 additions and 14 deletions

View File

@@ -199,7 +199,7 @@ class Badge < ActiveRecord::Base
def default_badge_grouping_id=(val)
# allow to correct orphans
if !self.badge_grouping_id || self.badge_grouping_id < 0
if !self.badge_grouping_id || self.badge_grouping_id <= BadgeGrouping::Other
self.badge_grouping_id = val
end
end