Sha256: fc8ea8e34d09837651cb183436879254bdc18b443441f717d65888ee6e280f0a
Contents?: true
Size: 846 Bytes
Versions: 24
Compression:
Stored size: 846 Bytes
Contents
require_relative "model" module Foobara module Manifest class Entity < Model self.category_symbol = :type optional_key(:associations, default: {}) alias entity_manifest model_manifest def has_associations? associations && !associations.empty? end 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_entity_name full_model_name end def associations @associations ||= self[:associations].to_h do |path_key, type_name| [path_key.to_sym, Type.new(root_manifest, [:type, type_name])] end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems