labimotion 1.4.0.rc7 → 1.4.0.rc9

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: ff15957fc41b34b4b25e4c76e73c1fb9d903a758fa80839ddf3db0c1adaad00c
4
- data.tar.gz: c8b1b781b8a7d0a53ee988d8d26ca300a3d808f0c7e192c703cfd608b1663d6e
3
+ metadata.gz: fb543b734cfa88ed1f5893b944b47228df997e61574c742e2b9aaa274f45693f
4
+ data.tar.gz: 986f63c50927aefb8e916bdce5df5cc65450e25affda62bd439ce7c39c99f5b6
5
5
  SHA512:
6
- metadata.gz: 423c73182f09f27ce911deb7306325160206da08cfee745a5b9131f8c8e288b291b80fd64c8b81933b9a124a6728be7788de8f04646d2d28bfec0df027ca75be
7
- data.tar.gz: d6ad47a79590d47766bd931615087d4d7db1083db95999874aff87c35ae94b7c0dcee8ff97ea027de3e01b73871864fcfa5462cdc619458c7711ee27b3f563a5
6
+ metadata.gz: 49535ea3462a5e4c5a14389ab8dc4b55a99ba9bd284561318a4d742b47ce67f1d2cc0ed235f86ad1b1d874345c7f5e4782ab8398ed4e9cc522444e946d849dcf
7
+ data.tar.gz: 9b5630097f7a17e752c3e90c5ef3d50b7b6fc72759b5e6755b74188a16f6efdef6b73a9dd9c4763a44916391286663a95602f519155ee7e4ec7c5392799d3bcd
@@ -377,8 +377,7 @@ module Labimotion
377
377
  end
378
378
  route_param :id do
379
379
  before do
380
- byebug
381
- @element_policy = ElementPolicy.new(current_user, Element.find(params[:id]))
380
+ @element_policy = ElementPolicy.new(current_user, Labimotion::Element.find(params[:id]))
382
381
  error!('401 Unauthorized', 401) unless current_user.matrix_check_by_name('genericElement') && @element_policy.read?
383
382
  rescue ActiveRecord::RecordNotFound
384
383
  error!('404 Not Found', 404)
@@ -16,6 +16,22 @@ module Labimotion
16
16
  self.class.name == 'Container' && container_type != 'dataset'
17
17
  end
18
18
 
19
+ def copy_dataset(orig_ds)
20
+ return if orig_ds.dataset.nil?
21
+
22
+ ods = orig_ds.dataset
23
+ uuid = SecureRandom.uuid
24
+ dataset = Labimotion::Dataset.create!(
25
+ uuid: uuid,
26
+ dataset_klass_id: ods.dataset_klass_id,
27
+ element_type: 'Container',
28
+ element_id: self.id,
29
+ properties: ods.properties,
30
+ properties_release: ods.properties_release,
31
+ klass_uuid: ods.klass_uuid,
32
+ )
33
+ end
34
+
19
35
  def save_dataset(**args)
20
36
  return if not_dataset?
21
37
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  ## Labimotion Version
4
4
  module Labimotion
5
- VERSION = '1.4.0.rc7'
5
+ VERSION = '1.4.0.rc9'
6
6
  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.4.0.rc7
4
+ version: 1.4.0.rc9
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-07-12 00:00:00.000000000 Z
12
+ date: 2024-07-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails