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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
avoid AR dirty checking showing changes on historic attributes eager loading
ulfertsd4b81c7f4b8d
diff --git a/lib/api/v3/work_packages/eager_loading/historic_attributes.rb b/lib/api/v3/work_packages/eager_loading/historic_attributes.rbindex 0ddf182ad04..bb986602615 100644--- a/lib/api/v3/work_packages/eager_loading/historic_attributes.rb+++ b/lib/api/v3/work_packages/eager_loading/historic_attributes.rb@@ -62,11 +62,8 @@ module API::V3::WorkPackages::EagerLoadingprivatedef set_attributes_at_timestamp(work_package, source, timestamp, override_current: false)- work_package.attributes = source.attributes.except('timestamp') if override_current- work_package.matches_filters_at_timestamp = source.matches_query_filters_at_timestamps.include?(timestamp)- work_package.exists_at_timestamp = source.exists_at_timestamps.include?(timestamp)- work_package.attributes_changed_to_baseline = source.changed_at_timestamp(timestamp)- work_package.with_query = source.query.present?+ override_attributes(work_package, source) if override_current+ set_timestamp_attributes(work_package, source, timestamp)enddef work_packages_with_historic_attributes@@ -81,6 +78,18 @@ module API::V3::WorkPackages::EagerLoadingdef timestamps@timestamps ||= query.try(:timestamps) || []end++ def override_attributes(work_package, source)+ work_package.attributes = source.attributes.except('timestamp')+ work_package.clear_changes_information+ end++ def set_timestamp_attributes(work_package, source, timestamp)+ work_package.matches_filters_at_timestamp = source.matches_query_filters_at_timestamps.include?(timestamp)+ work_package.exists_at_timestamp = source.exists_at_timestamps.include?(timestamp)+ work_package.attributes_changed_to_baseline = source.changed_at_timestamp(timestamp)+ work_package.with_query = source.query.present?+ endendmodule HistoricAttributesAccessors