lato_storage 3.0.7 → 3.0.9

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: 8b3a3c172eaed5975747221e31a8d12d8ef1062fd543e5022d6c44f65dbec033
4
- data.tar.gz: 1c0698af7f7b8bb298bdcc5107c9d63e45ec7b01764abec4b34167a01d0f5a47
3
+ metadata.gz: e199896f9f5ad40b9d4cc7e9975b066ae1b81d06f3ad90d0005cb0e416ec0855
4
+ data.tar.gz: 887b2b777d33419459b230557b99cd734bdc2c8bc819b3a6e20106a28ac1da36
5
5
  SHA512:
6
- metadata.gz: e832d19f93086c0a947c09166bb4d6f97d4d24f965787f73299330df4569eb59cdc78b7327883988707e1fa97caff6e6b1be8751873ee0ece5bea52dd116ac58
7
- data.tar.gz: 183d883e09d82607c19de8281313bbfda12eb139b53c86b8dde0741fb15fddfcbad9fea9f737d72e787829268efb5dc03bcca00f44225a6013e4b630cb2fed26
6
+ metadata.gz: 98afb16c68961b7301f1521b41fcfaadec1837cbaaf84f6a04432d21bcea42bd737fa62a382f46c7c5510d77a7dc86cf8bc3f645740f6a5ef9121ffd56d2beef
7
+ data.tar.gz: a044a096c20344cf0bf20a80ea779a035f4733df0ad816faec5e53b599913e9085b82bcd1e8c5ae08bf16f9bc235dae435b9ef9f21d865f927472da4a8718a53
@@ -31,7 +31,10 @@ module LatoStorage
31
31
  blobs_count = ActiveStorage::Blob.count
32
32
  attachments_count = ActiveStorage::Attachment.count
33
33
  variant_records_count = defined?(ActiveStorage::VariantRecord) ? ActiveStorage::VariantRecord.count : 0
34
- deletable_blobs_count = ActiveStorage::Blob.unattached.where('active_storage_blobs.created_at < ?', 12.hours.ago).count
34
+ # deletable_blobs_count = ActiveStorage::Blob.unattached.where('active_storage_blobs.created_at < ?', 12.hours.ago).count
35
+ deletable_blobs_count = ActiveStorage::Blob.joins("LEFT JOIN active_storage_attachments ON aquctive_storage_attachments.blob_id = active_storage_blobs.id")
36
+ .where("active_storage_attachments.blob_id IS NULL")
37
+ .where("active_storage_blobs.created_at < ?", 12.hours.ago).count
35
38
  total_storage = ActiveStorage::Blob.sum(:byte_size)
36
39
  avg_storage = blobs_count.positive? ? total_storage / blobs_count : 0
37
40
  content_types = ActiveStorage::Blob.group(:content_type).count.sort_by { |_, count| -count }.first(5)
@@ -1,3 +1,3 @@
1
1
  module LatoStorage
2
- VERSION = "3.0.7"
2
+ VERSION = "3.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato_storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.7
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-24 00:00:00.000000000 Z
11
+ date: 2025-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails