Sha256: 2be3cb7df10359675a03d368a8054b8a1b7fac5973cf389cf4f500f862173892

Contents?: true

Size: 730 Bytes

Versions: 5

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true
module SocialNetworking
  module Serializers
    # Serializes OnTheMindStatement models.
    class OnTheMindStatementSerializer < Serializer
      def to_serialized
        {
          className: "SocialNetworking::OnTheMindStatement",
          id: model.id,
          createdAt: model.created_at,
          createdAtRaw: model.created_at.to_i,
          participantId: model.participant_id,
          isAdmin: model.participant.is_admin,
          summary: "said #{model.description}",
          description: model.description,
          comments: CommentSerializer.from_collection(model.comments),
          likes: LikeSerializer.from_collection(model.likes)
        }
      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/on_the_mind_statement_serializer.rb
social_networking-0.13.2 app/models/social_networking/serializers/on_the_mind_statement_serializer.rb
social_networking-0.13.1 app/models/social_networking/serializers/on_the_mind_statement_serializer.rb
social_networking-0.13.0 app/models/social_networking/serializers/on_the_mind_statement_serializer.rb
social_networking-0.12.0 app/models/social_networking/serializers/on_the_mind_statement_serializer.rb