forest_liana 9.3.15 → 9.3.16

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: 53102b046de3c8137e31de9c1cdd7581d860e497ef870f0fee0c08e4faa34c3f
4
- data.tar.gz: 1eaf3d98e252b8683fb6b2398058dd86b269b45df5f6644c488d2aba5c110206
3
+ metadata.gz: 1d542e8e2e471ab7b14b4b47d71692e98a4889c09a95e72c61775cb1744c93d9
4
+ data.tar.gz: c3528129a4b519ef9d11f1c381476c1d300ffbe7ecd6845d754185bdb230f7bc
5
5
  SHA512:
6
- metadata.gz: 6ccf9b6efd785f8ffcc39f0e0514ba73c408b98ae5a842695279b38127fb17cc8e5b555391596c5e2132933cb981a9916d641ff5cb7fb58481cbe5928b1a5d1c
7
- data.tar.gz: 58c7b9630f16d8cbb00fa4c058a6002c635f3f07c0c3a0183989b9acbeda16667864a3e183fb1557faf6a38c1b6062056f720364722148fbfcd8facd6e4e4a3a
6
+ metadata.gz: b7ff03164f24e175ef86a4076ae2b5987df415734351f17850db84e075ed152203530030786e8de98959f646611429f95bb83afe7ec651659604737bdd5aaf53
7
+ data.tar.gz: 1e17aa30b9fa4cfd2914e14f198fe8a0ba999b29c60e1074629ab61b9dcff00417e34d5613552fe40a6c3164da28c0f31de25db41ca69317bda9357212a0aada
@@ -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 = "9.3.15"
2
+ VERSION = "9.3.16"
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: 9.3.15
4
+ version: 9.3.16
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-09-10 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