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

Initialize new agenda item with current user as presenter

Klaus Zanders1b731af5c7b1
diff --git a/modules/meeting/app/components/meeting_agenda_items/new_component.rb b/modules/meeting/app/components/meeting_agenda_items/new_component.rb
index ae6b62fa2b8..f20d74affa8 100644
--- a/modules/meeting/app/components/meeting_agenda_items/new_component.rb
+++ b/modules/meeting/app/components/meeting_agenda_items/new_component.rb
@@ -36,9 +36,19 @@ module MeetingAgendaItems
super
@meeting = meeting
- @meeting_agenda_item = meeting_agenda_item || MeetingAgendaItem.new(meeting:, author: User.current)
+ @meeting_agenda_item = meeting_agenda_item || build_agenda_item
@hidden = hidden
@type = type
end
+
+ private
+
+ def build_agenda_item
+ MeetingAgendaItem.new(
+ meeting: @meeting,
+ author: User.current,
+ presenter: User.current
+ )
+ end
end
end