Commit 93711ff4 authored by Marcia Ramos's avatar Marcia Ramos

Merge branch 'ewh-update-chtsheet' into 'master'

Update rails cheat sheet

See merge request gitlab-org/gitlab!30779
parents 5482eaf7 b6af35d7
...@@ -214,6 +214,20 @@ p.each do |project| ...@@ -214,6 +214,20 @@ p.each do |project|
end end
``` ```
### Bulk update to disable the Slack Notification service
To disable notifications for all projects that have Slack service enabled, do:
```ruby
# Grab all projects that have the Slack notifications enabled
p = Project.find_by_sql("SELECT p.id FROM projects p LEFT JOIN services s ON p.id = s.project_id WHERE s.type = 'SlackService' AND s.active = true")
# Disable the service on each of the projects that were found.
p.each do |project|
project.slack_service.update_attribute(:active, false)
end
```
## Wikis ## Wikis
### Recreate ### Recreate
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment