Commit 088655ff authored by Yorick Peterse's avatar Yorick Peterse

Move EE code from Issue to EE::Issue

This moves EE specific code from the Issue model into the EE::Issue
module, reducing the chance of developers running into merge conflicts.
parent 0e921c7c
......@@ -3,16 +3,12 @@
require 'carrierwave/orm/activerecord'
class Issue < ActiveRecord::Base
prepend EE::Issue
prepend EE::RelativePositioning
include AtomicInternalId
include IidRoutes
include Issuable
include Noteable
include Referable
include Spammable
include Elastic::IssuesSearch
include FasterCacheKeys
include RelativePositioning
include TimeTrackable
......@@ -45,9 +41,6 @@ class Issue < ActiveRecord::Base
has_many :issue_assignees
has_many :assignees, class_name: "User", through: :issue_assignees
has_one :epic_issue
has_one :epic, through: :epic_issue
validates :project, presence: true
alias_attribute :parent_ids, :project_id
......@@ -313,3 +306,5 @@ class Issue < ActiveRecord::Base
Gitlab::EtagCaching::Store.new.touch(key)
end
end
Issue.prepend(EE::Issue)
......@@ -9,9 +9,15 @@ module EE
WEIGHT_ANY = 'Any'.freeze
WEIGHT_NONE = 'None'.freeze
prepend EE::RelativePositioning
include Elastic::IssuesSearch
scope :order_weight_desc, -> { reorder ::Gitlab::Database.nulls_last_order('weight', 'DESC') }
scope :order_weight_asc, -> { reorder ::Gitlab::Database.nulls_last_order('weight') }
has_one :epic_issue
has_one :epic, through: :epic_issue
validates :weight, allow_nil: true, numericality: { greater_than_or_equal_to: 0 }
end
......
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