action_hooks 0.2.0 → 0.2.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: 284686e350568c9e92b85744b29ad6eb114657ae8872464292020edd97ed32ae
4
- data.tar.gz: 3f226eff09c69f48a0430bcedd6d8d6583ae4bf0c4cb359de9f13f833d4ce8e2
3
+ metadata.gz: 022311a2bf5d47588bef0c50d8ec661bea05a17cb12a9e9bf35538891588e803
4
+ data.tar.gz: 7026c3496e361f040b6ae619a9a72d9acf1f88e1df58e1de811fe259fb2c22a2
5
5
  SHA512:
6
- metadata.gz: 11209c21b103ca1e42b2970dc2d9bed285ac0b9b032824303a418d02da6850c1db36319aaf6f4fa30ee3b6eec7d815a066bd1ae091d9d033ad44dafcefdf88ca
7
- data.tar.gz: 1efbaf2b0533019d20e3d00f52b348bfa3f11a44b9880fd9676136575ebcaab2ce563a1363b92661552706a1cba88350d6feb14b7d4a11fe97fa5365de7f6bd7
6
+ metadata.gz: 7069d4534e137e09cf2ae10277300aaee50020999f1865e8a24d9ac6bea09ff0e3125c4dbdf3193eeda3ce48a743117e758dcf019f9e25b1005d91c7784398a3
7
+ data.tar.gz: c4e4483de897d4df4eb100d24740e3fcf3ffe0ff8b9afcf89497737c69e29f761b85841d9ab0fd423317b9c4b8bf595c021826db0f16cb495742382812467a79
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.1] - 2026-03-02
4
+
5
+ - Fixed migration template to detect primary key type from Rails generators configuration instead of hardcoded PostgreSQL UUID check
6
+ - Fixed JSON column type detection to use `t.respond_to?(:jsonb)` instead of checking adapter name directly
7
+
3
8
  ## [0.2.0] - 2026-03-02
4
9
 
5
10
  - Refactored ActionHooks to operate purely as middleware. It now automatically mounts `POST /webhooks/:source` without needing any generated configuration route handling.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionHooks
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -1,16 +1,11 @@
1
1
  class CreateWebhookRequests < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
2
2
  def change
3
- <%-
4
- json_type = (ActiveRecord::Base.connection.adapter_name.downcase == "postgresql") ? :jsonb : :json
5
-
6
- supports_uuid = if ActiveRecord::Base.connection.respond_to?(:supports_uuid?)
7
- ActiveRecord::Base.connection.supports_uuid? # PostgreSQL
8
- else
9
- false # Defaults for others like SQLite, typical MySQL setups unless explicitly configured
3
+ create_table :webhook_requests, id: primary_key_type do |t|
4
+ if t.respond_to?(:jsonb)
5
+ t.jsonb :payload, default: {}, null: false
6
+ else
7
+ t.json :payload, default: {}, null: false
10
8
  end
11
- -%>
12
- create_table :webhook_requests<%= supports_uuid ? ", id: :uuid" : "" %> do |t|
13
- t.<%= json_type %> :payload, default: {}, null: false
14
9
  t.string :source, null: false
15
10
  t.integer :state, null: false, default: 0
16
11
 
@@ -20,4 +15,11 @@ class CreateWebhookRequests < ActiveRecord::Migration[<%= ActiveRecord::Migratio
20
15
  add_index :webhook_requests, :source
21
16
  add_index :webhook_requests, :state
22
17
  end
18
+
19
+ private
20
+
21
+ def primary_key_type
22
+ config = Rails.configuration.generators
23
+ config.options[config.orm][:primary_key_type] || :primary_key
24
+ end
23
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_hooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Poimtsev