Fix badge type ordering

This commit is contained in:
riking 2014-08-25 12:48:31 -07:00
parent 99c11e2184
commit 234956234b
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,3 @@
export default Ember.ArrayController.extend({
sortProperties: ['grouping_position', 'badge.badgeType.id', 'badge.name', 'badge.id']
sortProperties: ['grouping_position', 'badge.badge_type.sort_order', 'badge.name', 'badge.id']
});

View File

@ -1,3 +1,9 @@
class BadgeTypeSerializer < ApplicationSerializer
attributes :id, :name
attributes :id, :name, :sort_order
# change this if/when we allow custom badge types
# correct for now, though
def sort_order
10 - object.id
end
end