This commit is contained in:
BoHung Chiu 2022-03-23 21:27:35 +08:00
parent 5ef5ccc370
commit 0c53aed510
2 changed files with 2 additions and 2 deletions

View File

@ -327,7 +327,9 @@ class Admin::AnnouncementsController < OrbitAdminController
Bulletin.where(:copy_id=>bulletin.id.to_s).destroy
bulletin.is_edit = true
bulletin.save
set_approved = bulletin.is_preview
bulletin = bulletin.get_org_model
bulletin.approved = true if set_approved
bps = bulletin_params
bps[:tags] = bps[:tags].blank? ? [] : bps[:tags]
bps[:email_member_ids] = bps[:email_member_ids].blank? ? [] : bps[:email_member_ids]

View File

@ -114,8 +114,6 @@ class Bulletin
org_model = nil
if self.copy_id
org_model = self.class.find(self.copy_id) rescue nil
else
org_model = self.class.where(:title=>self.title,:is_preview.ne=>true).desc(:updated_at).first
end
org_model.nil? ? self : org_model
else