labimotion 1.0.2 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d95cca4c3067ae72420caeba93fbaed69e9e948dfb8e673c395c3ae758b1419
4
- data.tar.gz: 7c5a469509b6dc448cce12d278c107b913a84d5e9efae2d57585f0b33db12143
3
+ metadata.gz: 6043cc7059f5394e70f75b1a06415fff819c17c210450ec0f335d896166709db
4
+ data.tar.gz: a20e04caa39ff947b878533a8d13f4019f5722d3a1a309d0066f776b648d3514
5
5
  SHA512:
6
- metadata.gz: ac1b93bf0e741d492daf65110ae91ffa3ef793852ddb8d7fd4c3f6ba73cc93b125d1a8898d0f79c7bf4aa20dc584e30d14279a04d4cc1ce3af5c0e149b69be2b
7
- data.tar.gz: 545fb7261afd1e503bb79e0eb0104512cd91545531461766b4efeac81a4a9a9d6d3949866be77966bff45e1f7cae0af4103aaeb722e025f5dbe830b01e977bbb
6
+ metadata.gz: 28b2d0ee49532e30873049b382275384bae81c8db730397727cadbad8c663b2e03fdd7b50f6c805ca09c99a3dffe1eef1d66378ca5802645ba324046f0cf07e9
7
+ data.tar.gz: b2130bd66485442b4944c73f2bb61755e6511d33ab6dd27895eab14df06417b6bb1d8feaa7945b77146b3ea2bc51a15748177cf416602750940312cdb9ec5173
@@ -23,7 +23,7 @@ module Labimotion
23
23
  uuid = SecureRandom.uuid
24
24
  props = args[:properties]
25
25
  props['pkg'] = Labimotion::Utils.pkg(props['pkg'])
26
- props['identifier'] = klass.identifier
26
+ props['identifier'] = klass.identifier if klass.identifier.present?
27
27
  props['uuid'] = uuid
28
28
  props['klass'] = 'Dataset'
29
29
 
@@ -41,14 +41,13 @@ module Labimotion
41
41
 
42
42
  def save_segments(**args) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
43
43
  return if args[:segments].nil?
44
-
45
44
  segments = []
46
- args[:segments].each do |seg|
45
+ args[:segments]&.each do |seg|
47
46
  klass = Labimotion::SegmentKlass.find_by(id: seg['segment_klass_id'])
48
47
  uuid = SecureRandom.uuid
49
48
  props = seg['properties']
50
49
  props['pkg'] = Labimotion::Utils.pkg(props['pkg'])
51
- props['identifier'] = identifier
50
+ props['identifier'] = klass.identifier if klass.identifier.present?
52
51
  props['uuid'] = uuid
53
52
  props['klass'] = 'Segment'
54
53
  segment = Labimotion::Segment.find_by(element_type: Labimotion::Utils.element_name(self.class.name), element_id: self.id, segment_klass_id: seg['segment_klass_id'])
@@ -59,7 +58,7 @@ module Labimotion
59
58
  next if segment.present?
60
59
 
61
60
  props['klass_uuid'] = klass.uuid
62
- segment = Labimotion::Segment.create!(properties_release: klass.properties_release, segment_klass_id: seg['segment_klass_id'], element_type: Labimotion::Utils.element_name(self.class.name), element_id: self.id, properties: props, created_by: args[:current_user_id], uuid: uuid, klass_uuid: klass.uuid)
61
+ segment = Labimotion::Segment.create!(properties_release: klass.properties_release, segment_klass_id: seg['segment_klass_id'], element_type: self.class.name, element_id: self.id, properties: props, created_by: args[:current_user_id], uuid: uuid, klass_uuid: klass.uuid)
63
62
  segments.push(segment)
64
63
  end
65
64
  segments
@@ -3,5 +3,5 @@
3
3
  module Labimotion
4
4
  IS_RAILS5 = false
5
5
  VERSION = '0.1.14' if Labimotion::IS_RAILS5 == true
6
- VERSION = '1.0.2' if Labimotion::IS_RAILS5 == false
6
+ VERSION = '1.0.5' if Labimotion::IS_RAILS5 == false
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: labimotion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chia-Lin Lin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-08-30 00:00:00.000000000 Z
12
+ date: 2023-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails