Sha256: 11ac5b97591f9007e22cffdac909db0753efc99820c0e7de20ca01b5383a0a30

Contents?: true

Size: 487 Bytes

Versions: 4

Compression:

Stored size: 487 Bytes

Contents

class UpdateForemanSetupPermissions < ActiveRecord::Migration[4.2]
  def self.up
    old_permission = ::Permission.where(:name => "edit_provisioning", :resource_type => nil).first
    new_permission = ::Permission.where(:name => "edit_provisioning", :resource_type => "ForemanSetup::Provisioner").first
    unless old_permission.nil?
      Filtering.where(:permission_id => old_permission.id).update_all(:permission_id => new_permission.id)
      old_permission.delete
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreman_setup-8.0.1 db/migrate/20140305165000_update_foreman_setup_permissions.rb
foreman_setup-8.0.0 db/migrate/20140305165000_update_foreman_setup_permissions.rb
foreman_setup-7.0.0 db/migrate/20140305165000_update_foreman_setup_permissions.rb
foreman_setup-6.0.0 db/migrate/20140305165000_update_foreman_setup_permissions.rb