Sha256: 473db4bada0a253c0190c111cf6d4fa73c90632986e1038e421862e6daad580c

Contents?: true

Size: 283 Bytes

Versions: 3

Compression:

Stored size: 283 Bytes

Contents

class RemoveOldDiscoveryReaderPermissions < ActiveRecord::Migration[4.2]
  def up
    Permission.where("name like '%_discovery_rules' and resource_type is null").find_each do |permission|
      permission.update(:resource_type => 'DiscoveryRule')
    end
  end

  def down
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_discovery-25.0.1 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-25.0.0 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-24.0.2 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb