Sha256: 02ff033ae1dfcb8bd6aaff55f9df5f13d639f702512054c117d583969984affc

Contents?: true

Size: 471 Bytes

Versions: 2

Compression:

Stored size: 471 Bytes

Contents

require 'ivy/serializers/documents/document'

module Ivy
  module Serializers
    module Documents
      class ResourceCollection < Document
        def generate_included(generator)
          @primary_resource.each { |resource| @serializer.relationships(self, resource) }
          super
        end

        def generate_primary_resource(generator)
          generator.primary_resources(@primary_resource_name, @primary_resource)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ivy-serializers-0.4.0 lib/ivy/serializers/documents/resource_collection.rb
ivy-serializers-0.3.0 lib/ivy/serializers/documents/resource_collection.rb