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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 022311a2bf5d47588bef0c50d8ec661bea05a17cb12a9e9bf35538891588e803
|
|
4
|
+
data.tar.gz: 7026c3496e361f040b6ae619a9a72d9acf1f88e1df58e1de811fe259fb2c22a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
data/lib/action_hooks/version.rb
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
class CreateWebhookRequests < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
|
2
2
|
def change
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|