forest_liana 8.3.2 → 8.3.3

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: 4851fbd997ec48e6ac11f64592b36ab0f76aa0f8941644876a2ec489e935d421
4
- data.tar.gz: '078c6cbea588211cae5f201455dedd0391b17505e7b786851a9f26ebff35d9ee'
3
+ metadata.gz: a4e97c61fafcfa35449d0198b68c6e9aa1ac070f43c09fb65337b88b75b7eb73
4
+ data.tar.gz: 56a2db7abad36e6242205497a155bc615b838148162bfa2019cc2201ae4d3aea
5
5
  SHA512:
6
- metadata.gz: 384cafcf6e22fd29047bdebc376150ce451bdd0f027b484e067c4bde166b3ba5ac0cbd0c736ffe924e7ea7074bc39f04a7a428822763934328de2e07fca022af
7
- data.tar.gz: 2778e7d5a7c6905e76b931040f6fc4ef6695e2be5d71a933a67eb3d21c519bb97300762b2252be90016e1c23db2d48e03b5cafd75275224457cf1999d9da193d
6
+ metadata.gz: 91031cc5688326bb38b7c8932965cd65a6aac71e0d44dc8c40867a826ab688339f0de2f14fae7723cee59e63173a3672db444391207bfe98f8ccd4000cb6af6e
7
+ data.tar.gz: 11dac2d84060f8414c97dcf8485444df9a50e20f21be995aa50f560b0003ae734b013e55ae187e00e57dd95de58fcea16d510e9a0d1a32968970a75edc181b81
@@ -76,6 +76,8 @@ module ForestLiana
76
76
  dissociator.perform
77
77
 
78
78
  head :no_content
79
+ rescue ActiveRecord::RecordNotDestroyed => error
80
+ render json: { errors: [{ status: :bad_request, detail: error.message }] }, status: :bad_request
79
81
  rescue => error
80
82
  FOREST_REPORTER.report error
81
83
  FOREST_LOGGER.error "Association Dissociate error: #{error}\n#{format_stacktrace(error)}"
@@ -31,7 +31,12 @@ module ForestLiana
31
31
 
32
32
  if @with_deletion
33
33
  record_ids = record_ids.select { |record_id| @association.klass.exists?(record_id) }
34
- @association.klass.destroy(record_ids)
34
+ @resource.transaction do
35
+ record_ids.each do |id|
36
+ record = @association.klass.find(id)
37
+ record.destroy!
38
+ end
39
+ end
35
40
  end
36
41
  end
37
42
  end
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "8.3.2"
2
+ VERSION = "8.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.3.2
4
+ version: 8.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-16 00:00:00.000000000 Z
11
+ date: 2024-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails