Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

obey rubocop

as-op17b7c5e77135
diff --git a/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb b/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb
index 53ad0e2a1ad..6f14fb672d0 100644
--- a/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb
+++ b/modules/reporting/app/workers/cost_query/pdf/timesheet_generator.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CostQuery::PDF::TimesheetGenerator
include WorkPackage::PDFExport::Common::Common
include WorkPackage::PDFExport::Common::Attachments
@@ -11,9 +13,9 @@ class CostQuery::PDF::TimesheetGenerator
H1_MARGIN_BOTTOM = 2
HR_MARGIN_BOTTOM = 16
TABLE_CELL_FONT_SIZE = 10
- TABLE_CELL_BORDER_COLOR = "BBBBBB".freeze
+ TABLE_CELL_BORDER_COLOR = "BBBBBB"
TABLE_CELL_PADDING = 4
- COMMENT_FONT_COLOR = "636C76".freeze
+ COMMENT_FONT_COLOR = "636C76"
H2_FONT_SIZE = 20
H2_MARGIN_BOTTOM = 10
@@ -172,7 +174,7 @@ class CostQuery::PDF::TimesheetGenerator
end
def sum_time_entries(entries)
- entries.map(&:hours).compact.sum
+ entries.filter_map(&:hours).sum
end
def build_table_row_comment(entry)