Sha256: 40c6b8c32c8004d156dfeb46e59fd6b4129c3cac6e5d6a9b12f15246fe3418a8

Contents?: true

Size: 766 Bytes

Versions: 11

Compression:

Stored size: 766 Bytes

Contents

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

11 entries across 11 versions & 1 rubygems

Version Path
social_networking-0.11.8 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.11.7 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.11.6 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.11.5 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.11.4 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.11.3 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.11.2 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.11.1 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.11.0 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.10.0 app/models/social_networking/serializers/goal_serializer.rb
social_networking-0.9.3 app/models/social_networking/serializers/goal_serializer.rb