summaryrefslogtreecommitdiff
path: root/app/models/milestone.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-24 00:09:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-24 00:09:52 +0000
commit0abfd0b478192436e7328469320923a04885a3b7 (patch)
tree89d0c8221a93de4bddf86e83eae08b3c18bd6c1a /app/models/milestone.rb
parent4e7abe540dbd1d170bfb2b3594e645cbfb48cac3 (diff)
downloadgitlab-ce-0abfd0b478192436e7328469320923a04885a3b7.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r--app/models/milestone.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index b0676c25f8e..8ae1fab963f 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -8,6 +8,7 @@ class Milestone < ApplicationRecord
include FromUnion
include Importable
include IidRoutes
+ include UpdatedAtFilterable
prepend_mod_with('Milestone') # rubocop: disable Cop/InjectEnterpriseEditionModule
@@ -26,6 +27,7 @@ class Milestone < ApplicationRecord
has_many :events, as: :target, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
+ scope :by_iid, ->(iid) { where(iid: iid) }
scope :active, -> { with_state(:active) }
scope :started, -> { active.where('milestones.start_date <= CURRENT_DATE') }
scope :not_started, -> { active.where('milestones.start_date > CURRENT_DATE') }