Sha256: 8f21db7eeb6bbb345cb3b325d6aea4d1cd28baca261e4666216e0ae00f047c1a
Contents?: true
Size: 913 Bytes
Versions: 11
Compression:
Stored size: 913 Bytes
Contents
module SocialNetworking module Serializers # Serializes Profile models. class ProfileSerializer < Serializer DEFAULT_ICON = "questionmark" def to_serialized if model.participant.is_admin icon_path = "social_networking/_profile_icon_admin.png" else icon_path = "social_networking/profile_icon_" + (model.icon_name || DEFAULT_ICON) + ".png" end { id: model.id, participantId: model.participant_id, username: model.user_name, latestAction: model.latest_action_at, endOfTrial: model.active_membership_end_date, isAdmin: model.participant.is_admin, isWoz: (model.participant.current_group.arm.woz? && model.participant.is_admin), iconSrc: ApplicationController.helpers.asset_path(icon_path) } end end end end
Version data entries
11 entries across 11 versions & 1 rubygems