Fix bug.
This commit is contained in:
parent
5ef5ccc370
commit
0c53aed510
|
@ -327,7 +327,9 @@ class Admin::AnnouncementsController < OrbitAdminController
|
||||||
Bulletin.where(:copy_id=>bulletin.id.to_s).destroy
|
Bulletin.where(:copy_id=>bulletin.id.to_s).destroy
|
||||||
bulletin.is_edit = true
|
bulletin.is_edit = true
|
||||||
bulletin.save
|
bulletin.save
|
||||||
|
set_approved = bulletin.is_preview
|
||||||
bulletin = bulletin.get_org_model
|
bulletin = bulletin.get_org_model
|
||||||
|
bulletin.approved = true if set_approved
|
||||||
bps = bulletin_params
|
bps = bulletin_params
|
||||||
bps[:tags] = bps[:tags].blank? ? [] : bps[:tags]
|
bps[:tags] = bps[:tags].blank? ? [] : bps[:tags]
|
||||||
bps[:email_member_ids] = bps[:email_member_ids].blank? ? [] : bps[:email_member_ids]
|
bps[:email_member_ids] = bps[:email_member_ids].blank? ? [] : bps[:email_member_ids]
|
||||||
|
|
|
@ -114,8 +114,6 @@ class Bulletin
|
||||||
org_model = nil
|
org_model = nil
|
||||||
if self.copy_id
|
if self.copy_id
|
||||||
org_model = self.class.find(self.copy_id) rescue nil
|
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
|
end
|
||||||
org_model.nil? ? self : org_model
|
org_model.nil? ? self : org_model
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue