summaryrefslogtreecommitdiffstats
path: root/app/models/time_entry_query.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/time_entry_query.rb')
-rw-r--r--app/models/time_entry_query.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/time_entry_query.rb b/app/models/time_entry_query.rb
index 600909dfd..bc7ef3b18 100644
--- a/app/models/time_entry_query.rb
+++ b/app/models/time_entry_query.rb
@@ -113,6 +113,13 @@ class TimeEntryQuery < Query
[['spent_on', 'desc']]
end
+ # If a filter against a single issue is set, returns its id, otherwise nil.
+ def filtered_issue_id
+ if value_for('issue_id').to_s =~ /\A(\d+)\z/
+ $1
+ end
+ end
+
def base_scope
TimeEntry.visible.
joins(:project, :user).