Commit 7a0b1b18 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'reduce-issue-model-conflicts' into 'master'

Move EE code from Issue to EE::Issue

See merge request gitlab-org/gitlab-ee!8047
parents e086a1a6 088655ff
......@@ -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