small fix for categories table
This commit is contained in:
parent
b39ebe583c
commit
28163dbeba
|
@ -177,16 +177,16 @@ class Admin::UniversalTablesController < OrbitAdminController
|
||||||
uid = params[:id].split("-").last
|
uid = params[:id].split("-").last
|
||||||
p = table_params
|
p = table_params
|
||||||
table = UTable.where(:uid => uid).first
|
table = UTable.where(:uid => uid).first
|
||||||
table.update_attributes(p)
|
|
||||||
table.save
|
|
||||||
cat = table.category rescue nil
|
cat = table.category rescue nil
|
||||||
if cat.nil?
|
if cat.nil?
|
||||||
cat = Category.new
|
cat = Category.new
|
||||||
cat.module_app = @module_app
|
cat.module_app = @module_app
|
||||||
cat.save
|
|
||||||
end
|
end
|
||||||
cat.title_translations = p[:title_translations]
|
cat.title_translations = p[:title_translations]
|
||||||
cat.save
|
cat.save
|
||||||
|
p[:category_id] = cat.id
|
||||||
|
table.update_attributes(p)
|
||||||
|
table.save
|
||||||
redirect_to admin_universal_tables_path
|
redirect_to admin_universal_tables_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue