Sha256: b716027ffc0e173d3dbfb175cc2802753e681cbb706f79237b6e59717204cf85

Contents?: true

Size: 278 Bytes

Versions: 41

Compression:

Stored size: 278 Bytes

Contents

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

  def down
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
foreman_discovery-23.0.2 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-24.0.1 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-24.0.0 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-23.0.1 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-23.0.0 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-22.0.4 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-21.0.5 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-22.0.2 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-21.0.4 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-21.0.3 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-21.0.2 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-19.0.5 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-19.0.4 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-21.0.1 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-19.0.3 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-21.0.0 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-19.0.2 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-20.0.1 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-20.0.0 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb
foreman_discovery-19.0.1 db/migrate/20150512150432_remove_old_discovery_reader_permissions.rb