mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-03 09:55:57 +08:00
14 lines
259 B
Ruby
14 lines
259 B
Ruby
# frozen_string_literal: true
|
|
|
|
class BadgeIndexSerializer < BadgeSerializer
|
|
attributes :has_badge
|
|
has_one :badge_grouping
|
|
|
|
def include_has_badge?
|
|
@options[:user_badges]
|
|
end
|
|
|
|
def has_badge
|
|
@options[:user_badges].include?(object.id)
|
|
end
|
|
end
|