Fix bug.
This commit is contained in:
parent
3030d5926b
commit
443d7d44d4
|
@ -635,6 +635,7 @@ class Admin::AnnouncementsController < OrbitAdminController
|
|||
params.require(:announcement_setting).permit!
|
||||
end
|
||||
def update_calendar(bps,bulletin)
|
||||
bps = bps.to_h.with_indifferent_access
|
||||
if bps[:add_to_calendar] == '0' && !bps[:event_id].blank?
|
||||
Event.find(bps[:event_id]).destroy rescue nil
|
||||
bps[:event_id] = nil
|
||||
|
|
|
@ -38,6 +38,9 @@ class Bulletin
|
|||
SubPart.class_eval { include BulletinModel::Cache }
|
||||
Page.class_eval { include BulletinModel::Cache }
|
||||
before_destroy do
|
||||
if self.event_id.present? && !defined?(Calendar).nil?
|
||||
Event.where(:id=>self.event_id).destroy
|
||||
end
|
||||
AnnsCache.all.destroy
|
||||
end
|
||||
field :is_edit, type: Boolean, default: false #use to check whether the preview record changed
|
||||
|
|
Loading…
Reference in New Issue