activerecord-minimizer 0.1.2 → 0.1.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: 765a2a713e6c6e2582ea3710affccdbfcae87fc798c40a8687f32856b24d2d6b
4
- data.tar.gz: 32d4267611a306b162b1a3c47d082c29b6a080d30ae066d3dfd1a6db1d4a69a7
3
+ metadata.gz: fd5b6b67995d6c1cbf665637d1c06d7bba3a481906a2dfab3478c1f7e9e303b0
4
+ data.tar.gz: f9a99422b743b0942a7e07d8de0fb43273f4ec2fdc9e9f1e34c0021e196a6aee
5
5
  SHA512:
6
- metadata.gz: 67faf17cd90cfd3583be2eefbc532423e75628270a198f1f55834c2881b62c3428db9c83b272e6ccfb4ffd5d1ecfe8f0233b8b2ce14cbc9f4a2671458d5cb923
7
- data.tar.gz: 8b9fafd7a79f04d9dda376491def78b8441003e9b948955c8a7e07d7a3bf06669842bdb7b3f2922509ec54932f580fe79110ac3779ca4be01cb3fdb090fffb83
6
+ metadata.gz: 1bc117e578665279e838e5ce2ea05d915c271a435224b21824e4ce51af8ac01a53248c2c7c3532f9fca3c46c2927927ff81d5b65a1db5dc93aa4dd267836fbb2
7
+ data.tar.gz: 8895e58f378594e9b92df76e98c72d6d377f6b6c2e1f9a77441677efc1ecdef23a15d2640cac6584940c0d7c5128ac8f563d225bbd471d5d1e5f8d58aa6652c2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.3 (2026-10-18)
4
+
5
+ - `ar_minimizer:manifest` stops, saying why, when no model's table exists (a database not set up yet), instead of writing a manifest that describes no models.
6
+
3
7
  ## 0.1.2 (2026-10-18)
4
8
 
5
9
  - Strict mode no longer breaks what gems and Rails call by name, so a keep
@@ -82,6 +82,12 @@ module ArMinimizer
82
82
  Rails.application.eager_load!
83
83
  path = Rails.root.join("config/ar_minimizer.json")
84
84
  index = ArMinimizer::Index.from_models
85
+ # Models whose tables can't be read are left out: with none readable
86
+ # (no database set up yet), the manifest would describe no models.
87
+ if ActiveRecord::Base.descendants.any? { !it.abstract_class? } &&
88
+ ActiveRecord::Base.descendants.none? { !it.abstract_class? && ArMinimizer::Index.table?(it) }
89
+ abort "ar_minimizer: no model's table exists in the #{Rails.env} database; set it up (bin/rails db:prepare) first"
90
+ end
85
91
  File.write(path, ArMinimizer::Manifest.dump(index))
86
92
  puts "ar_minimizer: #{path.relative_path_from(Rails.root)} (#{index.size} methods, #{ArMinimizer::Manifest.digest(index)})"
87
93
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ArMinimizer
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-minimizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampo Kuokkanen