Class: Actions::Katello::ContentView::Create

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

Instance Method Summary collapse

Instance Method Details

#humanized_nameObject



22
23
24
# File 'app/lib/actions/katello/content_view/create.rb', line 22

def humanized_name
  _("Create content view")
end

#plan(content_view, environment_ids = []) ⇒ Object



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

def plan(content_view, environment_ids = [])
  content_view.save!
  if content_view.rolling?
    new_version = content_view.create_new_version
    if environment_ids&.any?
      ::Katello::KTEnvironment.where(id: environment_ids).each do |environment|
        plan_action(AddToEnvironment, new_version, environment)
      end
    end
    repository_ids = content_view.repository_ids
    if repository_ids.any?
      content_view.reload
      plan_action(AddRollingRepoClone, content_view, repository_ids, environment_ids)
    end
  end
end