Commit 726dd584 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Move new Issue relations to EE namespace

parent cc441566
module EE module EE
module Issue module Issue
extend ActiveSupport::Concern
prepended do
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
end
# override # override
def check_for_spam? def check_for_spam?
author.support_bot? || super author.support_bot? || super
......
...@@ -35,12 +35,6 @@ class Issue < ActiveRecord::Base ...@@ -35,12 +35,6 @@ class Issue < ActiveRecord::Base
has_many :issue_assignees has_many :issue_assignees
has_many :assignees, class_name: "User", through: :issue_assignees has_many :assignees, class_name: "User", through: :issue_assignees
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
validates :project, presence: true validates :project, presence: true
scope :in_projects, ->(project_ids) { where(project_id: project_ids) } scope :in_projects, ->(project_ids) { where(project_id: project_ids) }
......
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