2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-07-18 01:46:36 -04:00
|
|
|
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
|
2016-03-25 15:32:48 -04:00
|
|
|
|
2014-07-18 01:46:36 -04:00
|
|
|
end
|