FIX: Build broken when someone didn't have an embed category
This commit is contained in:
parent
0dfeee8016
commit
676416f478
1 changed files with 6 additions and 2 deletions
|
@ -6,10 +6,14 @@ class CreateEmbeddableHosts < ActiveRecord::Migration
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
|
|
||||||
category_id = execute("SELECT c.id FROM categories AS c
|
category_id = 0;
|
||||||
|
category_row = execute("SELECT c.id FROM categories AS c
|
||||||
INNER JOIN site_settings AS s ON s.value = c.name
|
INNER JOIN site_settings AS s ON s.value = c.name
|
||||||
WHERE s.name = 'embed_category'")[0]['id'].to_i
|
WHERE s.name = 'embed_category'")
|
||||||
|
|
||||||
|
if category_row.cmd_tuples > 0
|
||||||
|
category_id = category_row[0]['id'].to_i
|
||||||
|
end
|
||||||
|
|
||||||
if category_id == 0
|
if category_id == 0
|
||||||
category_id = execute("SELECT value FROM site_settings WHERE name = 'uncategorized_category_id'")[0]['value'].to_i
|
category_id = execute("SELECT value FROM site_settings WHERE name = 'uncategorized_category_id'")[0]['value'].to_i
|
||||||
|
|
Reference in a new issue