Sha256: 000203182b43ea8c77283c4168ff300a7aeccdbece889d564b4dc4f95ada7ab5

Contents?: true

Size: 749 Bytes

Versions: 22

Compression:

Stored size: 749 Bytes

Contents

module Katello
  module Concerns
    # overrides Foreman Api::V2::HostsBulkActionsController
    module Api::V2::HostsBulkActionsControllerExtensions
      extend ActiveSupport::Concern
      require 'active_support/core_ext/string/inflections'

      module Overrides
        def bulk_destroy
          destroyed_count = @hosts.count
          @hosts.in_batches.each_record do |host|
            Katello::RegistrationManager.unregister_host(host, :unregistering => false)
          end
          process_response(true, { :message => _("Deleted %{host_count} %{hosts}") % { :host_count => destroyed_count, :hosts => 'host'.pluralize(destroyed_count) }})
        end
      end

      included do
        prepend Overrides
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
katello-4.11.0.rc2 app/controllers/katello/concerns/api/v2/hosts_bulk_actions_controller_extensions.rb
katello-4.11.0.rc1 app/controllers/katello/concerns/api/v2/hosts_bulk_actions_controller_extensions.rb