Sha256: 2f6df98cf17d50c139d676828aaf097ff2a12a3141b8580614332c17e62b9c17

Contents?: true

Size: 792 Bytes

Versions: 5

Compression:

Stored size: 792 Bytes

Contents

# frozen_string_literal: true
module SocialNetworking
  module Serializers
    # Serializes Goal models.
    class GoalSerializer < Serializer
      def to_serialized
        {
          className: "SocialNetworking::Goal",
          id: model.id,
          createdAt: model.created_at,
          participantId: model.participant_id,
          isAdmin: model.participant.is_admin,
          summary: "#{model.participant_id} set the goal " \
                   "#{model.description}",
          description: model.description,
          isCompleted: model.is_completed,
          isDeleted: model.is_deleted,
          dueOn: model.due_on ? model.due_on.to_s(:participant_date) : "",
          comments: CommentSerializer.from_collection(model.comments)
        }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
social_networking-0.13.3 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.13.2 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.13.1 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.13.0 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.12.0 app/models/social_networking/serializers/goal_serializer.rb