Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-07-01 16:34:10 +0300
committerJames Lopez <james@jameslopez.es>2016-07-01 16:34:10 +0300
commitf29c30475e621dedae24791ae9b144b6bef2f80a (patch)
tree3850dee7b3703d2e0046015ec84ed700379b0124 /app/models/issue.rb
parentd6d0a35598c6fefd31dcc6b43bc2698792788faa (diff)
use has_many relationship with events
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index ae177c041e7..60abd47409e 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -6,7 +6,6 @@ class Issue < ActiveRecord::Base
include Referable
include Sortable
include Taskable
- include Eventable
DueDateStruct = Struct.new(:title, :name).freeze
NoDueDate = DueDateStruct.new('No Due Date', '0').freeze
@@ -20,6 +19,8 @@ class Issue < ActiveRecord::Base
belongs_to :project
belongs_to :moved_to, class_name: 'Issue'
+ has_many :events, as: :target, dependent: :destroy
+
validates :project, presence: true
scope :cared, ->(user) { where(assignee_id: user) }