Sha256: b581de79c3ac4f5360509ca3a8a1e236cfd863fac1c46bddeea624b8d62978fd
Contents?: true
Size: 1.07 KB
Versions: 24
Compression:
Stored size: 1.07 KB
Contents
require_relative "type" module Foobara module Manifest class Model < Type self.category_symbol = :type alias model_manifest relevant_manifest def attributes_type Attributes.new(root_manifest, [*path, :attributes_type]) end def attribute_names attributes_type.attribute_names end def full_model_name scoped_full_name end # TODO: rename def has_associations?(type = attributes_type) case type when Entity true when Model has_associations?(type.attributes_type) when Attributes type.attribute_declarations.values.any? do |attribute_declaration| has_associations?(attribute_declaration) end when Array has_associations?(type.element_type) when TypeDeclaration has_associations?(type.to_type) when Type type.entity? else # :nocov: raise "not sure how to proceed with #{type}" # :nocov: end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems