diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 09:09:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-14 09:09:03 +0300 |
commit | 10213bf3b26c3c21f7683471d35d1cd052c41e9c (patch) | |
tree | 32d1c776e16f56e1fc7a2ad0d5550029c24a3473 /app/models | |
parent | c60a1173018e93e6bf433f87cb726adc979d1c8a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/concerns/milestoneable.rb | 6 | ||||
-rw-r--r-- | app/models/issue.rb | 3 | ||||
-rw-r--r-- | app/models/issue_milestone.rb | 6 | ||||
-rw-r--r-- | app/models/merge_request.rb | 3 | ||||
-rw-r--r-- | app/models/merge_request_milestone.rb | 6 | ||||
-rw-r--r-- | app/models/milestone.rb | 3 |
6 files changed, 0 insertions, 27 deletions
diff --git a/app/models/concerns/milestoneable.rb b/app/models/concerns/milestoneable.rb index 7fb3f95bf0a..7df6981a129 100644 --- a/app/models/concerns/milestoneable.rb +++ b/app/models/concerns/milestoneable.rb @@ -14,8 +14,6 @@ module Milestoneable validate :milestone_is_valid - after_save :write_to_new_milestone_relationship - scope :of_milestones, ->(ids) { where(milestone_id: ids) } scope :any_milestone, -> { where('milestone_id IS NOT NULL') } scope :with_milestone, ->(title) { left_joins_milestones.where(milestones: { title: title }) } @@ -41,10 +39,6 @@ module Milestoneable def milestone_is_valid errors.add(:milestone_id, message: "is invalid") if respond_to?(:milestone_id) && milestone_id.present? && !milestone_available? end - - def write_to_new_milestone_relationship - self.milestones = [milestone].compact if supports_milestone? && saved_change_to_milestone_id? - end end def milestone_available? diff --git a/app/models/issue.rb b/app/models/issue.rb index d01aa78a2c1..be702134ced 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -33,9 +33,6 @@ class Issue < ApplicationRecord has_internal_id :iid, scope: :project, track_if: -> { !importing? }, init: ->(s) { s&.project&.issues&.maximum(:iid) } - has_many :issue_milestones - has_many :milestones, through: :issue_milestones - has_many :events, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent has_many :merge_requests_closing_issues, diff --git a/app/models/issue_milestone.rb b/app/models/issue_milestone.rb deleted file mode 100644 index da030077d87..00000000000 --- a/app/models/issue_milestone.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -class IssueMilestone < ApplicationRecord - belongs_to :milestone - belongs_to :issue -end diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 14aa6ac066e..6c32bdadfa8 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -38,9 +38,6 @@ class MergeRequest < ApplicationRecord has_many :merge_request_context_commits has_many :merge_request_context_commit_diff_files, through: :merge_request_context_commits, source: :diff_files - has_many :merge_request_milestones - has_many :milestones, through: :merge_request_milestones - has_one :merge_request_diff, -> { order('merge_request_diffs.id DESC') }, inverse_of: :merge_request diff --git a/app/models/merge_request_milestone.rb b/app/models/merge_request_milestone.rb deleted file mode 100644 index 4fa1d1dcb33..00000000000 --- a/app/models/merge_request_milestone.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -class MergeRequestMilestone < ApplicationRecord - belongs_to :milestone - belongs_to :merge_request -end diff --git a/app/models/milestone.rb b/app/models/milestone.rb index b3278f48aa9..29c621c54d0 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -39,9 +39,6 @@ class Milestone < ApplicationRecord has_many :merge_requests has_many :events, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent - has_many :issue_milestones - has_many :merge_request_milestones - scope :of_projects, ->(ids) { where(project_id: ids) } scope :of_groups, ->(ids) { where(group_id: ids) } scope :active, -> { with_state(:active) } |