Sha256: 45fc77c2843809afbdbd9e36758054c2eedc65828fc5549e4c98ada335178661
Contents?: true
Size: 943 Bytes
Versions: 3
Compression:
Stored size: 943 Bytes
Contents
# frozen_string_literal: true 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
3 entries across 3 versions & 1 rubygems