Sha256: 1cba22bf32e8472df03c45366ae3889bc86b67c55fdb7963d7e28410cef7b90a
Contents?: true
Size: 587 Bytes
Versions: 22
Compression:
Stored size: 587 Bytes
Contents
# frozen_string_literal: true class RenameWebhookPermissions < ActiveRecord::Migration[6.0] PERMISSIONS = { 'view_webhook_targets' => 'view_webhooks', 'create_webhook_targets' => 'create_webhooks', 'edit_webhook_targets' => 'edit_webhooks', 'destroy_webhook_targets' => 'destroy_webhooks' }.freeze def up PERMISSIONS.each do |from, to| Permission.unscoped.find_by(name: from)&.update_columns(name: to) end end def down PERMISSIONS.each do |from, to| Permission.unscoped.find_by(name: to)&.update_columns(name: from) end end end
Version data entries
22 entries across 22 versions & 1 rubygems