Sha256: ec04716998fdda19d3f67fdd3497f03591acaae0fe3d3424f71dc0f62884462f
Contents?: true
Size: 620 Bytes
Versions: 4
Compression:
Stored size: 620 Bytes
Contents
class FixSccPermissions < ActiveRecord::Migration[5.2] PERMISSION_NAMES = { :view_scc => :view_scc_accounts, :use_scc => :use_scc_accounts, :new_scc => :new_scc_accounts, :edit_scc => :edit_scc_accounts, :delete_scc => :delete_scc_accounts, :sync_scc => :sync_scc_accounts, }.freeze def up PERMISSION_NAMES.each do |old_n, new_n| Permission.find_by(name: old_n)&.update(name: new_n, resource_type: 'SccAccount') end end def down PERMISSION_NAMES.each do |old_n, new_n| Permission.find_by(name: new_n)&.update(name: old_n, resource_type: nil) end end end
Version data entries
4 entries across 4 versions & 1 rubygems