summaryrefslogtreecommitdiff
path: root/app/models/occurrence.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/occurrence.rb')
-rw-r--r--app/models/occurrence.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/models/occurrence.rb b/app/models/occurrence.rb
index 3baf447..143124f 100644
--- a/app/models/occurrence.rb
+++ b/app/models/occurrence.rb
@@ -1,13 +1,12 @@
1# TODO Make a gem out of the c wrapper
2require 'chaos_calendar' 1require 'chaos_calendar'
3 2
4class Occurrence < ApplicationRecord 3class Occurrence < ApplicationRecord
5 4
6 # Associations 5 # Associations
7 6
8 belongs_to :node 7 belongs_to :node, optional: true
9 belongs_to :event 8 belongs_to :event
10 9
11 # Class Methods 10 # Class Methods
12 11
13 def self.find_in_range start_time, end_time 12 def self.find_in_range start_time, end_time
@@ -64,7 +63,7 @@ class Occurrence < ApplicationRecord
64 # Instance Methods 63 # Instance Methods
65 64
66 def summary 65 def summary
67 node.head.title 66 node&.head&.title || event.display_title
68 end 67 end
69 68
70end 69end