discourse/app/serializers/badge_index_serializer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
259 B
Ruby
Raw Normal View History

# 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