From 87e8ab8f05ec4adbe68522712bec27bdaca29cfa Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 12 Jan 2016 10:54:36 +0800 Subject: [PATCH] small fix for update --- app/controllers/admin/news_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/admin/news_controller.rb b/app/controllers/admin/news_controller.rb index fe10202..d3af478 100644 --- a/app/controllers/admin/news_controller.rb +++ b/app/controllers/admin/news_controller.rb @@ -111,7 +111,7 @@ class Admin::NewsController < OrbitAdminController def update uid = params[:id].split('-').last - news_bulletin = NewsBulletin.find_by(:uid=>uid) + news_bulletin = NewsBulletin.where(:uid=>uid).first rescue nil news_bulletin_params[:tags] = news_bulletin_params[:tags].blank? ? [] : news_bulletin_params[:tags] news_bulletin_params[:email_member_ids] = news_bulletin_params[:email_member_ids].blank? ? [] : news_bulletin_params[:email_member_ids] @@ -131,8 +131,6 @@ class Admin::NewsController < OrbitAdminController rescue e end end - else - bulletin.save end news_bulletin.save build_email(news_bulletin)