Commit 61f6b87c authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Add dependent destruction to issue links

parent 9b90bbad
......@@ -35,8 +35,8 @@ class Issue < ActiveRecord::Base
has_many :issue_assignees
has_many :assignees, class_name: "User", through: :issue_assignees
has_many :referenced_issue_links, class_name: 'IssueLink', foreign_key: :source_id
has_many :referred_by_issue_links, class_name: 'IssueLink', foreign_key: :target_id
has_many :referenced_issue_links, class_name: 'IssueLink', foreign_key: :source_id, dependent: :destroy
has_many :referred_by_issue_links, class_name: 'IssueLink', foreign_key: :target_id, dependent: :destroy
has_many :referenced_issues, through: :referenced_issue_links, source: :target
has_many :referred_by_issues, through: :referred_by_issue_links, source: :source
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment