wolf_core 0.1.52 → 0.1.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f74762f0c705aef833133df24c40412e470105162cc565bf35cb412dd35955a
4
- data.tar.gz: 3d150c7f02cd9b0ef8f41afc0908b7374fd0db42583dce8966be99a22c3f4040
3
+ metadata.gz: bd23957ae21f0fc7435745529121a874974f57b8776729d1fa8a7e9fb7d0ab7a
4
+ data.tar.gz: f08b20bd6d26cc46caff73b1cebf492d0002345c5c981757af7ead1fa369002a
5
5
  SHA512:
6
- metadata.gz: 151c5439548ac233db5b96235e0bb910042cc9afe11904bb4db01711bc586d5bd1beb0f04664b8c45150caea3d2f61114d166e08468ca23dc0d8029003123d9f
7
- data.tar.gz: ef952813004928e82cff0a122da53941b11b28276a8fb79697098172a7b2aef6111524e43e4391288b958d87245aa6e800de58844662d927dae94103c0ca3eba
6
+ metadata.gz: 386d1e3b66e8522629cd9cafd1d201ea5cc5cf4cb6af13a7b99ffea579220a9e1c5036d655b141c40deb3bfad4deccea649cdbc72210d78e0532f1b53e115e82
7
+ data.tar.gz: b45dc2f8b98480f6fce43482a217916297b5f14f3e8fe650b2af3da12565ae9942558edc1af4e6c82ccf038881c18030fb99c0f4301ad33fdb55cba72fb0a918
@@ -14,8 +14,7 @@ module WolfCore
14
14
  url: "#{ENV['FKM_URL']}/Prod/lookup?tenant=#{tenant}&source=#{source}&source_id=#{source_id}"
15
15
  )
16
16
  response = parse_http_response(response)
17
- log_object 'get_foreign_keys response is'
18
- log_object response
17
+ log_object response, title: 'get_foreign_keys response is'
19
18
  validate_http_response(response: response, message: 'Error getting foreign keys')
20
19
  response.body
21
20
  end
@@ -25,8 +24,7 @@ module WolfCore
25
24
  url: "#{ENV['FKM_URL']}/Prod/lookup?tenant=#{tenant}&destination=#{destination}&destination_id=#{destination_id}"
26
25
  )
27
26
  response = parse_http_response(response)
28
- log_object 'get_foreign_keys_by_destination response is'
29
- log_object response
27
+ log_object response, title: 'get_foreign_keys_by_destination response is'
30
28
  validate_http_response(response: response, message: 'Error getting foreign keys by destination id')
31
29
  response.body
32
30
  end
@@ -43,23 +41,23 @@ module WolfCore
43
41
  }
44
42
  )
45
43
  response = parse_http_response(response)
46
- log_object 'create_foreign_key response is'
47
- log_object response
44
+ log_object response, title: 'create_foreign_key response is'
48
45
  validate_http_response(response: response, message: 'Error creating foreign key')
49
46
  parse_http_response(response).body
50
47
  end
51
48
 
52
- # def find_or_create_foreign_key(tenant:, source:, source_id:, destination:, destination_id:)
53
- # destination_id = get_foreign_key_destination_id(
54
- # tenant: tenant, source: source, source_id: source_id,
55
- # destination: destination
56
- # )
57
- # return Result.success(data: { operation: :find }) if destination_id.present?
58
- # create_foreign_key(
59
- # tenant: tenant, source: source, source_id: source_id,
60
- # destination: destination, destination_id: destination_id
61
- # )
62
- # Result.success(data: { operation: :create })
63
- # end
49
+ def find_or_create_foreign_key(tenant:, source:, source_id:, destination:, destination_id:)
50
+ destination_id = get_foreign_key_destination_id(
51
+ tenant: tenant, source: source, source_id: source_id,
52
+ destination: destination
53
+ )
54
+ log_object "find_or_create_foreign_key destination_id is #{destination_id}"
55
+ return Result.success(data: { operation: :find }) if destination_id.present?
56
+ create_foreign_key(
57
+ tenant: tenant, source: source, source_id: source_id,
58
+ destination: destination, destination_id: destination_id
59
+ )
60
+ Result.success(data: { operation: :create })
61
+ end
64
62
  end
65
63
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "0.1.52"
4
+ VERSION = "0.1.54"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolf_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.52
4
+ version: 0.1.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-03 00:00:00.000000000 Z
11
+ date: 2024-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty