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:
Diffstat (limited to 'app/models/timelog.rb')
-rw-r--r--app/models/timelog.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/timelog.rb b/app/models/timelog.rb
index 3f0e827cf61..7c394736560 100644
--- a/app/models/timelog.rb
+++ b/app/models/timelog.rb
@@ -19,6 +19,14 @@ class Timelog < ApplicationRecord
joins(:project).where(projects: { namespace: group.self_and_descendants })
end
+ scope :in_project, -> (project) do
+ where(project: project)
+ end
+
+ scope :for_user, -> (user) do
+ where(user: user)
+ end
+
scope :at_or_after, -> (start_time) do
where('spent_at >= ?', start_time)
end