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

rely on delegation again

ulferts06045cc78e41
diff --git a/app/helpers/wiki_pages/at_version.rb b/app/helpers/wiki_pages/at_version.rb
index 839f3ce0ab9..7326b9bdfb6 100644
--- a/app/helpers/wiki_pages/at_version.rb
+++ b/app/helpers/wiki_pages/at_version.rb
@@ -46,6 +46,10 @@ class WikiPages::AtVersion < SimpleDelegator
delegate :text,
to: :data
+ delegate :updated_at,
+ to: :last_journal,
+ allow_nil: true
+
# The form_for helper will call the #to_model method on the object it is passed otherwise
# which will return the object itself. Any version handling intended by this class will be forfeit.
@@ -64,10 +68,6 @@ class WikiPages::AtVersion < SimpleDelegator
last_journal&.user
end
- def updated_at
- last_journal&.updated_at
- end
-
def journals
@journals ||= super.select { |j| j.version <= version.to_i }
end