AutoCommit Die Jun 9 18:03:02 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-06-09 18:03:02 +02:00
parent e70cc8405f
commit 852a893a32
5 changed files with 24 additions and 4 deletions

View File

@@ -132,7 +132,9 @@ class Neuigkeit < ActiveRecord::Base
self.has_calentries?
end
def relevant_calentry
self.calentries.min_by{|c| c.days_to_today * 1.3 * ((c.is_past?)? 2:1)}
ce = self.calentries.min_by{|c| c.days_to_today * 1.3 * ((c.is_past?)? 2:1)} if self.is_event?
ce= self.meeting.calentry if self.has_meeting?
ce
end
def update_cache
if self.has_meeting? && !self.meeting.calentry.nil?