summaryrefslogtreecommitdiff
path: root/app/models/milestone.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-07-01 15:34:10 +0200
committerJames Lopez <james@jameslopez.es>2016-07-01 15:34:10 +0200
commitf29c30475e621dedae24791ae9b144b6bef2f80a (patch)
tree3850dee7b3703d2e0046015ec84ed700379b0124 /app/models/milestone.rb
parentd6d0a35598c6fefd31dcc6b43bc2698792788faa (diff)
downloadgitlab-ce-f29c30475e621dedae24791ae9b144b6bef2f80a.tar.gz
use has_many relationship with events
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r--app/models/milestone.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index 2283376c8ac..2bd7f198030 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -11,13 +11,13 @@ class Milestone < ActiveRecord::Base
include Referable
include StripAttribute
include Milestoneish
- include Eventable
belongs_to :project
has_many :issues
has_many :labels, -> { distinct.reorder('labels.title') }, through: :issues
has_many :merge_requests
has_many :participants, -> { distinct.reorder('users.name') }, through: :issues, source: :assignee
+ has_many :events, as: :target, dependent: :destroy
scope :active, -> { with_state(:active) }
scope :closed, -> { with_state(:closed) }