usa 0.4.0 → 0.4.1

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: 03b2542ffafa029a4598cdcd0226b8c088fb86b581048ac9a0ad31143bf24e77
4
- data.tar.gz: df5d33713273555f55bfef5f55b7c179095737de5aafb65a3ebaec7928ad78f1
3
+ metadata.gz: d8275113ba717d4dcd16a6ab69e75c3d2a0ae317138d4da57d3b6ceb5e534408
4
+ data.tar.gz: 4182c9028362c42327acd46f14cbad052c5074594820a7db581cf3aa9445561d
5
5
  SHA512:
6
- metadata.gz: cdcae36d574ba780eb0443dac939f3e3c01768a8bcb64e658eb0c8b4562cb6b2f6c53c2c16d8f59474fcc83b1eb9f0bfae192271a57027b2613c1ff97098f0bd
7
- data.tar.gz: ca491f71bf66c03ca86ebe972122fd0b2afbf9fb8568cb64f0f3fd05089e334e91ba80ad65e62bae9d3ae2cc919189235a5c5ba40e64b0ab48ea42d267aeb88e
6
+ metadata.gz: 14589ea7e3c01ec46a705f3777c38bc11a0670733b6fd8c2551499955a32e274516c37d93f8668c632ade9c2aca925ea556e08ef5ce9344126bc4b51e22a2768
7
+ data.tar.gz: 6cecb88f8f456ad77f6a353ed1cafba16fb369ef46d4aa71b95af0e6e971dd9a1bc943042edab8d5e0e6496ec48c9d59274ad74cadff5d61773da31fba37e0ea
data/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## 0.4.1 - 2026-09-16
11
+
12
+ * [Fix] The check that refuses a host's own class where one of these models should be is asked
13
+ when Active Record loads rather than while the app boots. It ran in a `to_prepare` block, and
14
+ reaching for `State` there pulled Active Record in behind it before initialization was over --
15
+ which Rails warns about on every boot that does not eager load: a `rake` task, a Heroku release
16
+ command, a development console. The check itself is unchanged, and still refuses before any of
17
+ these models is used
18
+
10
19
  ## 0.4.0 - 2026-09-15
11
20
 
12
21
  * [Breaking change] The models are `State`, `County`, `City`, `CityCounty` and `ZIP`, at the
data/README.md CHANGED
@@ -12,7 +12,7 @@ To install on your system, run
12
12
 
13
13
  To use inside a bundled Ruby project, add this line to the `Gemfile`:
14
14
 
15
- gem 'usa', '~> 0.4.0'
15
+ gem 'usa', '~> 0.4.1'
16
16
 
17
17
  Below 1.0 the pin stops at the next minor rather than the next major, because that is where a
18
18
  breaking change may still land. It becomes `~> 1.0` once the API is settled on purpose.
data/lib/usa/engine.rb CHANGED
@@ -4,6 +4,11 @@ require 'rails/engine'
4
4
  module USA
5
5
  # Teaches Rails where this gem's models live, and refuses a host that has taken their names.
6
6
  class Engine < ::Rails::Engine
7
- config.to_prepare { USA.verify_models ::State, ::County, ::City, ::CityCounty, ::ZIP }
7
+ # Asked when Active Record loads rather than while the app boots: reaching for these
8
+ # models pulls Active Record in behind them, and pulling it in before initialization is
9
+ # over slows every boot and can reorder a host's own -- which is what Rails warns about.
10
+ ActiveSupport.on_load(:active_record) do
11
+ USA.verify_models ::State, ::County, ::City, ::CityCounty, ::ZIP
12
+ end
8
13
  end
9
14
  end
data/lib/usa/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module USA
2
2
  # The version of this gem, as RubyGems knows it.
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.1'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo