omen 0.2.1 → 0.2.2

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: c5ce1b7049f103291d3d3aabb7d02bb80271bb7dca022bb1250db4855b59a4e9
4
- data.tar.gz: e323629870bf6d657fa4f43b0c47018eeed8af9946733f962d0e51889297ddcf
3
+ metadata.gz: 7bff8c4c873f1cbc8923e3dbc7cebe42e282126624a56cab8d2461b8c879fb0d
4
+ data.tar.gz: e8bd747cf8234259e52e7bf5d1ab24e607dc5ba6ba09deef01f037692bd3a6f7
5
5
  SHA512:
6
- metadata.gz: ff778fcc7568f43a7b0252793443c18ab0aee925c9030dcdef9af262934eb62bfb3a9e34af21c0cb7a4f6d096cdde812fd216fc4c64008095443f44ffea3ab70
7
- data.tar.gz: 1aea2af528735383465416dd6dcbd24770b983e630934e4ecf170e36d90120e9fbbf21e85efbd25eb6aa59860ba3c753cb66c97983f61ca5ea9785041a72d3e3
6
+ metadata.gz: 1c82de79367f41a2712f44bdf21d6ca715c263fbc097dae9d7dcd032ba28a152ebf4c1976b02b37f62992781f98981fab99fd49173a4925bea3664ba668cbff1
7
+ data.tar.gz: 0a2a09480ee44f60283db5db8976d6c97d6373fca2af7f6e1b2526de51052e5aba96b171ba989af70ef7bf5e9acd1fb01bbd6933cb9ec1b6cf00a10be80f0a8e
data/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## 0.2.2 - 2026-08-24
11
+
12
+ * [Fix] Run a load hook as each model loads, so a host declares `broadcasts_refreshes` and the
13
+ rest through `ActiveSupport.on_load :omen_reading` rather than by naming the class while
14
+ initializers run, which loaded Active Record before Rails was up
15
+ * [Fix] Read the adapter through the `:active_record` load hook, so a boot that never touches
16
+ the database is not the boot that loads it early
17
+
10
18
  ## 0.2.1 - 2026-08-24
11
19
 
12
20
  * [Fix] Declare `eastern()` over an instant as well as a stored timestamp, so a reply that
data/README.md CHANGED
@@ -119,7 +119,7 @@ Two things a subclass cannot reach, because the gem's own class is what a job lo
119
119
  line in the host does it:
120
120
 
121
121
  ```ruby
122
- Rails.application.config.to_prepare { Omen::Reading.broadcasts_refreshes }
122
+ ActiveSupport.on_load(:omen_reading) { broadcasts_refreshes }
123
123
  ```
124
124
 
125
125
  ## After the first deploy
@@ -35,3 +35,5 @@ class Omen::Answer < Omen.config.record
35
35
  # @return [Boolean] whether the answer ran past what is shown.
36
36
  def truncated? = result.size > Omen.config.maximum_rows
37
37
  end
38
+
39
+ ActiveSupport.run_load_hooks :omen_answer, Omen::Answer
@@ -11,3 +11,5 @@ class Omen::Question < Omen.config.record
11
11
  # @return [String] the side of the conversation this was said on, in the words the API uses.
12
12
  def role = 'user'
13
13
  end
14
+
15
+ ActiveSupport.run_load_hooks :omen_question, Omen::Question
@@ -16,3 +16,5 @@ class Omen::Reading < Omen.config.record
16
16
  # @return [String] the default representation (used in views).
17
17
  def to_s = questions.first&.text.to_s.truncate 80
18
18
  end
19
+
20
+ ActiveSupport.run_load_hooks :omen_reading, Omen::Reading
data/lib/omen/engine.rb CHANGED
@@ -7,10 +7,12 @@ module Omen
7
7
  # initializer has already said where its schema is. The declared format rather than the
8
8
  # applied one, so nothing here depends on which after_initialize hook ran first.
9
9
  config.after_initialize do
10
- configured = ActiveRecord::Base.configurations.configs_for env_name: Rails.env,
11
- name: 'primary'
12
- Omen::Requirements.met adapter: configured&.adapter, schema: Omen.config.schema,
13
- schema_format: Rails.application.config.active_record.schema_format
10
+ ActiveSupport.on_load :active_record do
11
+ configured = ActiveRecord::Base.configurations.configs_for env_name: Rails.env,
12
+ name: 'primary'
13
+ Omen::Requirements.met adapter: configured&.adapter, schema: Omen.config.schema,
14
+ schema_format: Rails.application.config.active_record.schema_format
15
+ end
14
16
  end
15
17
  end
16
18
  end
data/lib/omen/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Omen
2
2
  # The version of this gem, as RubyGems knows it.
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo