From 05a5d81ad2808fc5117b931864e404b7d5fe9449 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Thu, 22 Jan 2026 21:56:07 -0800 Subject: [PATCH] fix(integrations): avoid readonly hook_type updates --- app/models/integrations/hook.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/integrations/hook.rb b/app/models/integrations/hook.rb index 518b405da..698d32ffd 100644 --- a/app/models/integrations/hook.rb +++ b/app/models/integrations/hook.rb @@ -86,7 +86,11 @@ class Integrations::Hook < ApplicationRecord end def ensure_hook_type - self.hook_type = app.params[:hook_type] if app.present? + return unless app.present? + return unless new_record? + + # hook_type is readonly; only set it on create to avoid update-time errors in Rails 7.1+ + self.hook_type = app.params[:hook_type] end def validate_settings_json_schema