diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2011-06-28 17:53:04 +0200 |
---|---|---|
committer | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2011-07-05 11:58:11 +0200 |
commit | 38bfc2754eeb6db9697a1f258fc652875566e8ba (patch) | |
tree | 96a52e05501106bf901bd2f13fef35947d2b32b7 /site/app/models/user.rb | |
parent | Agenda.current creates new agenda if needed (diff) | |
download | council-webapp-38bfc2754eeb6db9697a1f258fc652875566e8ba.tar.gz council-webapp-38bfc2754eeb6db9697a1f258fc652875566e8ba.tar.bz2 council-webapp-38bfc2754eeb6db9697a1f258fc652875566e8ba.zip |
Show slacking status properly when there were no meetings yet.
Diffstat (limited to 'site/app/models/user.rb')
-rw-r--r-- | site/app/models/user.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/site/app/models/user.rb b/site/app/models/user.rb index 7809e87..cde0df5 100644 --- a/site/app/models/user.rb +++ b/site/app/models/user.rb @@ -58,6 +58,9 @@ class User < ActiveRecord::Base num_status = 0 agendas = Agenda.all :conditions => ['agendas.meeting_time BETWEEN ? AND ?', start_date, end_date], :order => :meeting_time + + return 'There were no meetings in this term yet' if agendas.count.zero? + for agenda in agendas if Participation.participant_is(self).agenda_is(agenda).count == 0 num_status += 1 if num_status < 3 |