FIX: keep correct ordering on admin badges

This commit is contained in:
Sam
2014-07-30 08:35:15 +10:00
parent b196de0821
commit 5a3466a6c3
2 changed files with 10 additions and 1 deletions

View File

@ -4,7 +4,9 @@ class Admin::BadgesController < Admin::AdminController
data = {
badge_types: BadgeType.all.order(:id).to_a,
badge_groupings: BadgeGrouping.all.order(:position).to_a,
badges: Badge.all.to_a,
badges: Badge.includes(:badge_grouping)
.references(:badge_grouping)
.order('badge_groupings.position, badge_type_id, badges.name').to_a,
protected_system_fields: Badge.protected_system_fields,
triggers: Badge.trigger_hash
}