Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Update the default status of the hooks to enabled (#7652)
In the recent Slack integration update, we made changes to how hooks are handled. Now, hooks require an additional check to be enabled. By default, new hooks are created in a disabled state, which might lead to issues with the hooks not being executed as expected. This migration updates the status attribute of hooks to have 'enabled' as the default value, ensuring that new hooks are enabled by default and can function properly.
- Loading branch information
1 parent
62e9fc1
commit 3a547de
Showing
3 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
db/migrate/20230801180936_update_default_status_in_hooks.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class UpdateDefaultStatusInHooks < ActiveRecord::Migration[7.0] | ||
def up | ||
change_column_default :integrations_hooks, :status, 1 | ||
|
||
update_default_status | ||
end | ||
|
||
def down | ||
change_column_default :integrations_hooks, :status, 0 | ||
end | ||
|
||
private | ||
|
||
def update_default_status | ||
Integrations::Hook.all.update(status: 'enabled') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters