fixture_fox 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fixture_fox/analyzer.rb +13 -7
- data/lib/fixture_fox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d169cf91f6468fcd829b7edd7af5309c4a15ff17e7087d2a75609fa7ea97b606
|
4
|
+
data.tar.gz: 2d99e4c1329f4cde08ac5f808c593f5cc92d086db7f8fb8bb909932aa6a96f67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b4bee30d8d492878f68a511730e7dda92b9db40c9a4c3be68f4e5db0a14464a9879cb7d7c3d570dab3c849352decb45df6e8f6441ae5dea8eb238ee1c7450ac
|
7
|
+
data.tar.gz: b33f654ff11fd0935c49f83492829d010dd035dfaf2034229c16272d5610a2127fd097c0fe2cd60cf9234755ac1edb6b2992e455a3fa34b9fb8bdd6c2869f15f
|
data/lib/fixture_fox/analyzer.rb
CHANGED
@@ -211,8 +211,6 @@ module FixtureFox
|
|
211
211
|
end
|
212
212
|
|
213
213
|
def generate_record_ids
|
214
|
-
# puts "generate_record_ids"
|
215
|
-
# puts " ids: #{@ids}"
|
216
214
|
@super_table_records = [] # Array of pairs of super_table/id
|
217
215
|
records.each { |ast_record|
|
218
216
|
table = ast_record.type.table
|
@@ -270,19 +268,17 @@ module FixtureFox
|
|
270
268
|
records.each { |record|
|
271
269
|
record.members.each { |field|
|
272
270
|
table = nil # To bring table into scope. FIXME: Yt?
|
271
|
+
# puts "#{field.class}"
|
273
272
|
case field
|
274
273
|
when AstFieldMember
|
275
|
-
# puts "AstFieldMember: #{field}"
|
276
274
|
table = record.type.table
|
277
275
|
column = field.column.postgres_column
|
278
276
|
idr.put(table.schema.name, table.name, record.id, column, field.value.value)
|
279
277
|
when AstReferenceMember
|
280
|
-
# puts "AstReferenceMember: #{field}"
|
281
278
|
table = record.type.table
|
282
279
|
column = field.column.postgres_column
|
283
280
|
idr.put(table.schema.name, table.name, record.id, column, field.referenced_anchor.id)
|
284
281
|
when AstRecordMember
|
285
|
-
# puts "AstRecordMember: #{record.type}"
|
286
282
|
column = field.column
|
287
283
|
|
288
284
|
this_record_id = field.record.id
|
@@ -300,7 +296,6 @@ module FixtureFox
|
|
300
296
|
idr.put(schema.name, table.name, that_record_id, link_column, this_record_id)
|
301
297
|
end
|
302
298
|
when AstTableMember
|
303
|
-
# puts "AstTableMember: #{field}"
|
304
299
|
if field.column.is_a?(PgGraph::Type::MmTableColumn)
|
305
300
|
table = mm_table = field.column.mm_table
|
306
301
|
this_mm_column = field.column.this_mm_column
|
@@ -316,11 +311,22 @@ module FixtureFox
|
|
316
311
|
else
|
317
312
|
table = record_table = field.column.type.table
|
318
313
|
record_column = field.column
|
314
|
+
|
319
315
|
field.elements.each { |r|
|
320
316
|
record_id = r.is_a?(AstReferenceElement) ? r.referenced_anchor.id : r.id
|
317
|
+
if record_table[record_column.that_link_column].kind?
|
318
|
+
key_schema_name = record_column.table.schema.name
|
319
|
+
key_table_name = record_column.table.name
|
320
|
+
key_record_id = record.id
|
321
|
+
key_field = record_column.this_link_column.to_sym
|
322
|
+
key = idr.data[key_schema_name][key_table_name][key_record_id][key_field]
|
323
|
+
else
|
324
|
+
key = record.id
|
325
|
+
end
|
326
|
+
|
321
327
|
idr.put(
|
322
328
|
record_table.schema.name, record_table.name,
|
323
|
-
record_id, record_column.that_link_column,
|
329
|
+
record_id, record_column.that_link_column, key)
|
324
330
|
}
|
325
331
|
end
|
326
332
|
else
|
data/lib/fixture_fox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fixture_fox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|