diff options
Diffstat (limited to 'app/models/timelog.rb')
-rw-r--r-- | app/models/timelog.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/app/models/timelog.rb b/app/models/timelog.rb index b8ca6e1fdd0..bd543526685 100644 --- a/app/models/timelog.rb +++ b/app/models/timelog.rb @@ -14,12 +14,8 @@ class Timelog < ApplicationRecord belongs_to :user belongs_to :note - scope :for_issues_in_group, -> (group) do - joins(:issue).where( - 'EXISTS (?)', - Project.select(1).where(namespace: group.self_and_descendants) - .where('issues.project_id = projects.id') - ) + scope :in_group, -> (group) do + joins(:project).where(projects: { namespace: group.self_and_descendants }) end scope :between_times, -> (start_time, end_time) do |