labimotion 1.1.1 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/labimotion/models/concerns/segmentable.rb +3 -2
- data/lib/labimotion/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: ba9c0a13422ef51e2463f066ca1520dec3e8dbb49df8a448456dcce071be8eb0
|
4
|
+
data.tar.gz: 9db0ceb23bb34a5dedf6e7f1a139218e23e76c76a4cc6b2df710ac7faa885ccf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 299af77b27b54a9ad05f7d4ca60617d5bf44b3346eff277f29166fb9be1dd6f97b6505b521b4990cf0c6dd0e6cb31f138b375557cd26616801b3fd4427e9c84a
|
7
|
+
data.tar.gz: 0d15088710b59d7ec17a9c1692ca56dd4dd8ce08bc2b49dae3c4a4ee374af7496957905b07b6ecbbf256c49ce82a865c7cb80e8fde0a2013aa41515fa711ab8a
|
@@ -7,7 +7,7 @@ module Labimotion
|
|
7
7
|
module Segmentable
|
8
8
|
extend ActiveSupport::Concern
|
9
9
|
included do
|
10
|
-
has_many :segments, as: :element, dependent: :destroy, class_name: 'Labimotion::Segment'
|
10
|
+
has_many :segments, -> { select('DISTINCT ON (element_type, segment_klass_id) *').order(element_type: :asc, segment_klass_id: :asc, id: :desc) }, as: :element, dependent: :destroy, class_name: 'Labimotion::Segment'
|
11
11
|
end
|
12
12
|
|
13
13
|
def copy_segments(**args)
|
@@ -52,10 +52,11 @@ module Labimotion
|
|
52
52
|
props['uuid'] = uuid
|
53
53
|
props['klass'] = 'Segment'
|
54
54
|
props = Labimotion::SampleAssociation.update_sample_association(props, args[:current_user_id])
|
55
|
-
segment = Labimotion::Segment.
|
55
|
+
segment = Labimotion::Segment.where(element_type: self.class.name, element_id: self.id, segment_klass_id: seg['segment_klass_id']).order(id: :desc).first
|
56
56
|
if segment.present? && (segment.klass_uuid != props['klass_uuid'] || segment.properties != props)
|
57
57
|
segment.update!(properties_release: klass.properties_release, properties: props, uuid: uuid, klass_uuid: props['klass_uuid'])
|
58
58
|
segments.push(segment)
|
59
|
+
Labimotion::Segment.where(element_type: self.class.name, element_id: self.id, segment_klass_id: seg['segment_klass_id']).where.not(id: segment.id).destroy_all
|
59
60
|
end
|
60
61
|
next if segment.present?
|
61
62
|
|
data/lib/labimotion/version.rb
CHANGED
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.1.
|
4
|
+
version: 1.1.3
|
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: 2024-01-
|
12
|
+
date: 2024-01-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|