Class: Actions::Katello::ContentView::Destroy

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

Instance Method Summary collapse

Instance Method Details

#finalizeObject



24
25
26
27
28
# File 'app/lib/actions/katello/content_view/destroy.rb', line 24

def finalize
  content_view = ::Katello::ContentView.find(input[:content_view][:id])
  content_view.content_view_repositories.each(&:destroy)
  content_view.destroy!
end

#humanized_nameObject



30
31
32
# File 'app/lib/actions/katello/content_view/destroy.rb', line 30

def humanized_name
  _("Delete")
end

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



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/lib/actions/katello/content_view/destroy.rb', line 7

def plan(content_view, options = {})
  action_subject(content_view)
  if options.fetch(:check_ready_to_destroy, true)
    content_view.check_ready_to_destroy!
  end

  sequence do
    concurrence do
      content_view.content_view_versions.each do |version|
        plan_action(ContentViewVersion::Destroy, version, options)
      end
    end

    plan_self
  end
end