From 5e8a2b5458c0a010d55543b4854d4c5a23819f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sch=C3=A4fer?= Date: Sat, 5 Mar 2011 22:33:09 +0100 Subject: [PATCH] Blank comment field for agenda/minutes. --- app/models/meeting_content.rb | 6 ++++++ app/models/meeting_minutes.rb | 3 +++ features/meeting_close.feature | 2 ++ 3 files changed, 11 insertions(+) diff --git a/app/models/meeting_content.rb b/app/models/meeting_content.rb index 8d5dafde8a..2f1d8dbd5e 100644 --- a/app/models/meeting_content.rb +++ b/app/models/meeting_content.rb @@ -21,6 +21,12 @@ class MeetingContent < ActiveRecord::Base (content_to && content_from) ? WikiDiff.new(content_to, content_from) : nil end + protected + + def after_initialize + self.comment = nil + end + class Version unloadable diff --git a/app/models/meeting_minutes.rb b/app/models/meeting_minutes.rb index 8235b27397..8000f41541 100644 --- a/app/models/meeting_minutes.rb +++ b/app/models/meeting_minutes.rb @@ -3,8 +3,11 @@ class MeetingMinutes < MeetingContent meeting.agenda.present? && meeting.agenda.locked? end + protected + def after_initialize # set defaults self.text ||= meeting.agenda.text if meeting.present? && meeting.agenda.present? + super end end \ No newline at end of file diff --git a/features/meeting_close.feature b/features/meeting_close.feature index fd7877a642..d5408efd66 100644 --- a/features/meeting_close.feature +++ b/features/meeting_close.feature @@ -43,6 +43,8 @@ Feature: Close and open meeting agendas Given the role "user" may have the following rights: | view_meetings | | close_meeting_agendas | + And the meeting "Bobs Meeting" has 1 agenda with: + | text | "blubber" | When I login as "alice" And I go to the Meetings page for the project called "dingens" And I click on "Bobs Meeting"