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: include journable_type condition in subquery

Sebastian Fiedlschusteracf0d5580dbc
diff --git a/app/models/journable/historic_active_record_relation.rb b/app/models/journable/historic_active_record_relation.rb
index f0c3ce31048..c503fa1f8f2 100644
--- a/app/models/journable/historic_active_record_relation.rb
+++ b/app/models/journable/historic_active_record_relation.rb
@@ -204,7 +204,7 @@ class Journable::HistoricActiveRecordRelation < ActiveRecord::Relation
#
def add_timestamp_condition(relation)
relation.joins_values = [journals_join_statement] + relation.joins_values
- relation.merge(Journal.at_timestamp(timestamp))
+ relation.merge(Journal.where(journable_type: model.name).at_timestamp(timestamp))
end
def journals_join_statement