small fix for deleting category if not present

This commit is contained in:
Harry Bomrah 2016-01-27 13:08:32 +08:00
parent 28163dbeba
commit 3abcd5a09a
1 changed files with 1 additions and 1 deletions

View File

@ -193,7 +193,7 @@ class Admin::UniversalTablesController < OrbitAdminController
def destroy def destroy
uid = params[:id].split("-").last uid = params[:id].split("-").last
table = UTable.where(:uid => uid).first table = UTable.where(:uid => uid).first
table.category.destroy table.category.destroy if !table.category.nil?
table.destroy table.destroy
redirect_to admin_universal_tables_path redirect_to admin_universal_tables_path
end end