activeitem 0.0.5 → 0.0.7

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: eb93b14273a49d3d4c7fa9c9ffb51164eaa504f031f66cafeec853cabda2742d
4
- data.tar.gz: b94e92229ce16523f029d7695a70cfcb1db2c90b6e4d0641ccb865b5e84a5301
3
+ metadata.gz: '0449e0de4aa951adcf2bdd085d145a0673439115fd8a51b7de275f60c461ecd9'
4
+ data.tar.gz: 5e580ffadfd8ee4b22fbd6f4c54b934330c832383baf07f9c601e64e3fd3a99a
5
5
  SHA512:
6
- metadata.gz: 4c5a15aa9fdfd5b8079f53d3a57225ed3622559256f6df129a44c1d822b6d0cdf5b380e130f28cd34ba328baa4113bda48dfcf4c0e9949a4f5d1bbab922060ad
7
- data.tar.gz: 2d66cf596eb64088d2e0758e9d967947e26708188e7b1fe4d0dddded8290a2e0b03c4a691668414b7e29a2b4310f25cb592b77430c6855e9bc5af87e2b1fb86f
6
+ metadata.gz: 4ad8dbfafc70f15ade76a5e030e505e8af3e7b3186d355ac5d16de97843f905f7789471bb04e706ef84fb012fa8de3d0c361973514c33ecc5f534efd9e4f8c3b
7
+ data.tar.gz: ddc7e4f5bf1ab8a814e2d3e58c103d01d2446f85599802925ff7e624d95ffd8ae559e66cc0b7c941adfd160a0f1c166cfac77104f5e84f48dd5dd7c570f58a58
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.7
4
+
5
+ ### Added
6
+
7
+ - `destroy!` — raises `ActiveItem::RecordNotDestroyed` when the record cannot be destroyed (e.g., callbacks halt the chain)
8
+
9
+ ## 0.0.6
10
+
11
+ ### Added
12
+
13
+ - `Model.destroy_all` — class-level method that scans the table and calls `destroy` on each record (runs callbacks)
14
+ - `Model.delete_all` — class-level method that scans the table and calls `delete` on each record (skips callbacks)
15
+
16
+ ### Fixed
17
+
18
+ - `delete_all` now correctly skips callbacks (was previously delegating to `destroy_all`)
19
+
3
20
  ## 0.0.5
4
21
 
5
22
  ### Fixed
@@ -420,6 +420,10 @@ module ActiveItem
420
420
  false
421
421
  end
422
422
 
423
+ def destroy!
424
+ destroy || raise(RecordNotDestroyed.new(nil, self))
425
+ end
426
+
423
427
  def delete
424
428
  perform_destroy
425
429
  true
@@ -18,6 +18,16 @@ module ActiveItem
18
18
  end
19
19
  end
20
20
 
21
+ # Raised by destroy! when the record is not destroyed.
22
+ class RecordNotDestroyed < StandardError
23
+ attr_reader :record
24
+
25
+ def initialize(message = nil, record = nil)
26
+ @record = record
27
+ super(message || 'Failed to destroy the record')
28
+ end
29
+ end
30
+
21
31
  # Raised when a record cannot be deleted because dependent associations
22
32
  # with :restrict_with_exception still exist.
23
33
  class DeleteRestrictionError < StandardError
@@ -286,10 +286,14 @@ module ActiveItem
286
286
  where(**conditions).limit(1).any?
287
287
  end
288
288
 
289
- def delete_all
289
+ def destroy_all
290
290
  all.destroy_all
291
291
  end
292
292
 
293
+ def delete_all
294
+ all.delete_all
295
+ end
296
+
293
297
  # Define GSI indexes for the model
294
298
  # This enables automatic index detection in where() queries
295
299
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveItem
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.7'
5
5
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeitem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis
@@ -41,7 +41,7 @@ cert_chain:
41
41
  mR0ObwJ14vsQVbJibq0eRHIg8G4yV19pvEdJCli02eLl1+451M63HZAqBNuyJ9Ny
42
42
  I1fxbbEBAzf7WHfoKdwFMuRZq7hpdLykCA8YQJFlLLFoXT0g41ug9iOKBtGg
43
43
  -----END CERTIFICATE-----
44
- date: 2026-05-26 00:00:00.000000000 Z
44
+ date: 2026-06-01 00:00:00.000000000 Z
45
45
  dependencies:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: activemodel
metadata.gz.sig CHANGED
Binary file