Fix calendar missing bug.

This commit is contained in:
BoHung Chiu 2020-12-16 18:25:08 +08:00
parent 3195214d08
commit 253261abf2
1 changed files with 5 additions and 2 deletions

View File

@ -65,8 +65,11 @@ module VenueLinkFile
if key_id.nil? if key_id.nil?
self.calendar_dict[key] = Event.create(update_dict.merge(create_user_id: current_user_id)).id self.calendar_dict[key] = Event.create(update_dict.merge(create_user_id: current_user_id)).id
else else
calendar = Event.find(key_id) calendar = Event.find(key_id) rescue nil
calendar.update_attributes(update_dict) calendar.update_attributes(update_dict) if !calendar.nil?
if calendar.nil?
self.calendar_dict[key] = Event.create(update_dict.merge(create_user_id: current_user_id)).id
end
end end
end end
end end