Fix deadline was set to nil when update

This commit is contained in:
Christophe Vilayphiou 2012-08-14 16:23:34 +08:00
parent efaed060d9
commit bcc13a47e6
2 changed files with 2 additions and 2 deletions

View File

@ -301,7 +301,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
protected
def delete_out_invalid_date_from_params
if(params[:bulletin]["deadline(1i)"].blank? or params[:bulletin]["deadline(2i)"].blank? or params[:bulletin]["deadline(3i)"].blank?)
if((params[:bulletin]["deadline(1i)"] && params[:bulletin]["deadline(1i)"].blank?) or (params[:bulletin]["deadline(2i)"] && params[:bulletin]["deadline(2i)"].blank?) or (params[:bulletin]["deadline(3i)"] && params[:bulletin]["deadline(3i)"].blank?))
params[:bulletin].delete("deadline(1i)")
params[:bulletin].delete("deadline(2i)")
params[:bulletin].delete("deadline(3i)")

View File

@ -338,7 +338,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController
protected
def delete_out_invalid_date_from_params
if(params[:news_bulletin]["deadline(1i)"].blank? or params[:news_bulletin]["deadline(2i)"].blank? or params[:news_bulletin]["deadline(3i)"].blank?)
if((params[:news_bulletin]["deadline(1i)"] && params[:news_bulletin]["deadline(1i)"].blank?) or (params[:news_bulletin]["deadline(2i)"] && params[:news_bulletin]["deadline(2i)"].blank?) or (params[:news_bulletin]["deadline(3i)"] && params[:news_bulletin]["deadline(3i)"].blank?))
params[:news_bulletin].delete("deadline(1i)")
params[:news_bulletin].delete("deadline(2i)")
params[:news_bulletin].delete("deadline(3i)")