Sha256: b5e8338027733badc25894803aaf935ac96d38ae4e7507e09858030b69cf6c99

Contents?: true

Size: 632 Bytes

Versions: 8

Compression:

Stored size: 632 Bytes

Contents

require_relative "model"

module Foobara
  module Manifest
    class DetachedEntity < Model
      # this isn't inherited? why not?
      self.category_symbol = :type

      optional_key(:associations, default: {})

      alias detached_entity_manifest model_manifest

      def primary_key_name
        primary_key_attribute.to_s
      end

      def primary_key_type
        @primary_key_type ||= TypeDeclaration.new(root_manifest, [*path, :primary_key_type])
      end

      def attribute_names
        super - [primary_key_name]
      end

      def full_detached_entity_name
        full_model_name
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
foobara-0.0.38 projects/manifest/src/foobara/manifest/detached_entity.rb
foobara-0.0.37 projects/manifest/src/foobara/manifest/detached_entity.rb
foobara-0.0.36 projects/manifest/src/foobara/manifest/detached_entity.rb
foobara-0.0.35 projects/manifest/src/foobara/manifest/detached_entity.rb
foobara-0.0.34 projects/manifest/src/foobara/manifest/detached_entity.rb
foobara-0.0.33 projects/manifest/src/foobara/manifest/detached_entity.rb
foobara-0.0.32 projects/manifest/src/foobara/manifest/detached_entity.rb
foobara-0.0.31 projects/manifest/src/foobara/manifest/detached_entity.rb