mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 21:50:24 +08:00
14 lines
265 B
Ruby
14 lines
265 B
Ruby
|
class BasicUserBadgeSerializer < ApplicationSerializer
|
||
|
attributes :id, :granted_at, :count, :grouping_position
|
||
|
|
||
|
has_one :badge
|
||
|
|
||
|
def include_count?
|
||
|
object.respond_to? :count
|
||
|
end
|
||
|
|
||
|
def grouping_position
|
||
|
object.badge.badge_grouping.position
|
||
|
end
|
||
|
end
|