From 11b43afc9a98e7f62f5b64398f7459724389fb6c Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 13 Apr 2016 12:09:00 +0200 Subject: [PATCH] [bug taiga#25] allow event update if no places nb was set --- app/models/event.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index f30c8ec5e..22e04ab3f 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -86,7 +86,9 @@ class Event < ActiveRecord::Base end def update_nb_free_places - diff = nb_total_places - nb_total_places_was - self.nb_free_places += diff + unless nb_total_places_was.nil? + diff = nb_total_places - nb_total_places_was + self.nb_free_places += diff + end end end