Class: Actions::Katello::ActivationKey::Destroy

Inherits:
EntryAction
  • Object
show all
Defined in:
app/lib/actions/katello/activation_key/destroy.rb

Instance Method Summary collapse

Instance Method Details

#finalizeObject



13
14
15
16
# File 'app/lib/actions/katello/activation_key/destroy.rb', line 13

def finalize
  activation_key = ::Katello::ActivationKey.find(input[:activation_key][:id])
  activation_key.destroy!
end

#humanized_nameObject



18
19
20
# File 'app/lib/actions/katello/activation_key/destroy.rb', line 18

def humanized_name
  _("Delete Activation Key")
end

#plan(activation_key, options = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'app/lib/actions/katello/activation_key/destroy.rb', line 5

def plan(activation_key, options = {})
  skip_candlepin = options.fetch(:skip_candlepin, false)
  action_subject(activation_key)

  plan_action(Candlepin::ActivationKey::Destroy, cp_id: activation_key.cp_id) unless skip_candlepin
  plan_self
end