From a7a6ad786eeb9f94f7882462bccbdd31e1bb4743 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 30 Jun 2026 19:15:22 +0200 Subject: Phase 1: standalone events, external_url on nodes - Migration: node_id nullable on events and occurrences, add title/description/is_primary to events, external_url to nodes - Existing events marked is_primary: true (were all 1:1 with nodes) - Node: has_one :event -> has_many :events - Event: belongs_to :node optional, validates title presence for standalone events, is_primary uniqueness scoped to node_id, display_title helper falling back through node title - Occurrence: belongs_to :node optional, summary falls back to event.display_title - nodes_helper: event_information uses events.first (interim; will be replaced in Phase 3 event UI) - Tests: fix node.event -> node.events.first in event_test --- test/models/event_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/models/event_test.rb b/test/models/event_test.rb index f310af8..d85aadd 100644 --- a/test/models/event_test.rb +++ b/test/models/event_test.rb @@ -74,17 +74,17 @@ class EventTest < ActiveSupport::TestCase assert_equal "2009-12-24T15:23:42".to_time, scoped_occurrences[51].start_time assert_equal "2009-12-24T20:05:23".to_time, scoped_occurrences[51].end_time - assert_equal @cal_node.event, scoped_occurrences[51].event + assert_equal @cal_node.events.first, scoped_occurrences[51].event assert_equal @cal_node, scoped_occurrences[51].node assert_equal "2009-03-19T15:23:42".to_time, scoped_occurrences[11].start_time assert_equal "2009-03-19T20:05:23".to_time, scoped_occurrences[11].end_time - assert_equal @cal_node.event, scoped_occurrences[11].event + assert_equal @cal_node.events.first, scoped_occurrences[11].event assert_equal @cal_node, scoped_occurrences[11].node assert_equal "2009-01-01T15:23:42".to_time, scoped_occurrences[0].start_time assert_equal "2009-01-01T20:05:23".to_time, scoped_occurrences[0].end_time - assert_equal @cal_node.event, scoped_occurrences[11].event + assert_equal @cal_node.events.first, scoped_occurrences[11].event assert_equal @cal_node, scoped_occurrences[11].node end @@ -111,4 +111,4 @@ class EventTest < ActiveSupport::TestCase chaosradio_days = scoped_occurrences.map {|x| x.start_time.day} assert_equal expected_days, chaosradio_days end -end \ No newline at end of file +end -- cgit v1.3