2019-05-03 08:17:27 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2014-08-25 10:38:20 -07:00
|
|
|
class BasicUserBadgeSerializer < ApplicationSerializer
|
|
|
|
|
attributes :id, :granted_at, :count, :grouping_position
|
|
|
|
|
|
|
|
|
|
has_one :badge
|
|
|
|
|
|
|
|
|
|
def include_count?
|
|
|
|
|
object.respond_to? :count
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def grouping_position
|
2019-12-03 00:37:01 -07:00
|
|
|
object.badge&.badge_grouping&.position
|
2014-08-25 10:38:20 -07:00
|
|
|
end
|
|
|
|
|
end
|