Skip to content

Commit

Permalink
Destroy Staging Workflow when we destroy the main project
Browse files Browse the repository at this point in the history
When we deleted a project associated to a Staging Workflow, this staging
was not deleted. That caused that we couldn't delete the remaning staging
projects.

Fix #8729.
  • Loading branch information
David Kang committed Nov 18, 2019
1 parent 87e8fe6 commit 268e2b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def autocomplete(search)
has_many :target_of_bs_request_actions, class_name: 'BsRequestAction', foreign_key: 'target_project_id'
has_many :target_of_bs_requests, through: :target_of_bs_request_actions, source: :bs_request

has_one :staging, class_name: 'Staging::Workflow', inverse_of: :project
has_one :staging, class_name: 'Staging::Workflow', inverse_of: :project, dependent: :destroy

default_scope { where('projects.id not in (?)', Relationship.forbidden_project_ids) }

Expand Down

0 comments on commit 268e2b1

Please sign in to comment.