summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/occurrence.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/occurrence.rb b/app/models/occurrence.rb
index 667ba6f..591e1e0 100644
--- a/app/models/occurrence.rb
+++ b/app/models/occurrence.rb
@@ -20,6 +20,15 @@ class Occurrence < ActiveRecord::Base
20 ) 20 )
21 end 21 end
22 22
23 def self.find_next
24 find(
25 :all,
26 :limit => 1,
27 :include => :node,
28 :conditions => ["start_time > ?", Time.now]
29 )
30 end
31
23 # Deletes all Occurrences which belong to the given event. Afterwards a few 32 # Deletes all Occurrences which belong to the given event. Afterwards a few
24 # variables are set to save repetitive queries. The occurrences of the given 33 # variables are set to save repetitive queries. The occurrences of the given
25 # event are then calculated and created. 34 # event are then calculated and created.