From b39ebe583c0d729567a4b1554c9d71e8924e1df5 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 15 Jan 2016 15:01:07 +0800 Subject: [PATCH] added category fix for table --- app/controllers/admin/universal_tables_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/universal_tables_controller.rb b/app/controllers/admin/universal_tables_controller.rb index c518055..690db3f 100644 --- a/app/controllers/admin/universal_tables_controller.rb +++ b/app/controllers/admin/universal_tables_controller.rb @@ -179,7 +179,12 @@ class Admin::UniversalTablesController < OrbitAdminController table = UTable.where(:uid => uid).first table.update_attributes(p) table.save - cat = table.category + cat = table.category rescue nil + if cat.nil? + cat = Category.new + cat.module_app = @module_app + cat.save + end cat.title_translations = p[:title_translations] cat.save redirect_to admin_universal_tables_path