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

HistoricActiveRecordRelation: refactoring multi-line sql string

Sebastian Fiedlschuster668762a28050
diff --git a/app/models/journable/historic_active_record_relation.rb b/app/models/journable/historic_active_record_relation.rb
index 1b10b597e2c..f0c3ce31048 100644
--- a/app/models/journable/historic_active_record_relation.rb
+++ b/app/models/journable/historic_active_record_relation.rb
@@ -217,8 +217,8 @@ class Journable::HistoricActiveRecordRelation < ActiveRecord::Relation
#
def add_join_on_journables_table_with_created_at_column(relation)
relation \
- .joins("INNER JOIN (SELECT id, created_at FROM \"#{model.table_name}\") AS journables
- ON \"journables\".\"id\" = \"journals\".\"journable_id\"".gsub("\n", ""))
+ .joins("INNER JOIN (SELECT id, created_at FROM \"#{model.table_name}\") AS journables " \
+ "ON \"journables\".\"id\" = \"journals\".\"journable_id\"")
end
# Gather the columns we need in our model from the different tables in the sql query: