Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/jobs/shipit/destroy_stack_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def perform(stack)

delete(Shipit::OutputChunk.joins(:task).where(task: { stack_id: stack.id }))
delete(Shipit::Task.where(stack_id: stack.id))

delete(Shipit::Commit.where(stack_id: stack.id))

stack.destroy!
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/shipit/stack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def blank?
has_many :github_hooks, dependent: :destroy, class_name: 'Shipit::GithubHook::Repo'
has_many :hooks, dependent: :destroy
has_many :api_clients, dependent: :destroy
has_one :continuous_delivery_schedule
has_one :continuous_delivery_schedule, dependent: :destroy
belongs_to :lock_author, class_name: :User, optional: true
belongs_to :repository
validates_associated :repository
Expand Down