From 58b5f5509cd91dd8837556d4505ec5b8cb5fad6c Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 1 Jun 2020 13:10:51 +0800 Subject: [PATCH] Fix announcement create error. --- app/controllers/admin/announcements_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/announcements_controller.rb b/app/controllers/admin/announcements_controller.rb index 1517437..e9fb486 100644 --- a/app/controllers/admin/announcements_controller.rb +++ b/app/controllers/admin/announcements_controller.rb @@ -191,6 +191,7 @@ class Admin::AnnouncementsController < OrbitAdminController def create bps = bulletin_params + bulletin = Bulletin.new(bps) if !bps['bulletin_links_attributes'].nil? bps['bulletin_links_attributes'].each do |idx,link| bps['bulletin_links_attributes'].delete(idx.to_s) if link['url'].blank? @@ -207,7 +208,6 @@ class Admin::AnnouncementsController < OrbitAdminController bps[:is_hidden] = false end - bulletin = Bulletin.new(bps) if !defined?(Calendar).nil? if bps[:add_to_calendar] == '0' && !bps[:event_id].blank? Event.find(bps[:event_id]).destroy rescue nil