Class: Actions::Katello::ContentViewVersion::Destroy

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

Instance Method Summary collapse

Instance Method Details

#finalizeObject



23
24
25
26
# File 'app/lib/actions/katello/content_view_version/destroy.rb', line 23

def finalize
  version = ::Katello::ContentViewVersion.find_by(id: input[:id])
  version&.destroy!
end

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



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

def plan(version, options = {})
  version.validate_destroyable!(skip_environment_check: options[:skip_environment_check])

  destroy_env_content = !options.fetch(:skip_destroy_env_content, false)
  repos = destroy_env_content ? version.repositories : version.archived_repos

  sequence do
    concurrence do
      repos.each do |repo|
        repo_options = options.clone
        plan_action(Repository::Destroy, repo, repo_options)
      end
    end
  end

  plan_self(:id => version.id)
end