20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'foobara-0.0.110/projects/detached_entity/src/concerns/reflection.rb', line 20
def foobara_manifest
associations = foobara_associations.map do |(path, type)|
entity_class = type.target_class
entity_name = entity_class.foobara_type.scoped_full_name
[path, entity_name]
end.sort.to_h
deep_associations = foobara_deep_associations.map do |(path, type)|
entity_class = type.target_class
entity_name = entity_class.foobara_type.scoped_full_name
[path, entity_name]
end.sort.to_h
base_manifest = superclass.respond_to?(:foobara_manifest) ? super : {}
base_manifest.merge(
Util.remove_blank(
depends_on: foobara_depends_on.map(&:full_entity_name),
deep_depends_on: foobara_deep_depends_on.map(&:full_entity_name),
associations:,
deep_associations:,
entity_name: foobara_model_name,
primary_key_attribute: foobara_primary_key_attribute,
primary_key_type:
foobara_attributes_type.declaration_data[:element_type_declarations][foobara_primary_key_attribute]
)
)
end
|