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

simplify and inline to_changes_format

Ivan Kuchinde66820b5918
diff --git a/lib_static/plugins/acts_as_journalized/lib/acts/journalized/journable_differ.rb b/lib_static/plugins/acts_as_journalized/lib/acts/journalized/journable_differ.rb
index 56909c6bbd4..064ef9e3d82 100644
--- a/lib_static/plugins/acts_as_journalized/lib/acts/journalized/journable_differ.rb
+++ b/lib_static/plugins/acts_as_journalized/lib/acts/journalized/journable_differ.rb
@@ -94,13 +94,7 @@ module Acts::Journalized
old_value.to_s.strip == new_value.to_s.strip
end
- to_changes_format(changes, association_name.to_s)
- end
-
- def to_changes_format(references, key)
- references.each_with_object({}) do |(id, (old_value, new_value)), result|
- result["#{key}_#{id}"] = [old_value, new_value]
- end
+ changes.transform_keys { |id| "#{association_name}_#{id}" }
end
def merge_reference_journals_by_id(old_journals, new_journals, id_key, value)