FIX: Do not error when importing a theme with empty files
This commit is contained in:
parent
6bbdf5b56e
commit
428536788c
|
@ -149,7 +149,7 @@ class RemoteTheme < ActiveRecord::Base
|
|||
end
|
||||
|
||||
# Destroy fields that no longer exist in the remote theme
|
||||
field_ids_to_destroy = theme.theme_fields.pluck(:id) - updated_fields.map(&:id)
|
||||
field_ids_to_destroy = theme.theme_fields.pluck(:id) - updated_fields.map { |tf| tf&.id }
|
||||
ThemeField.where(id: field_ids_to_destroy).destroy_all
|
||||
|
||||
if !skip_update
|
||||
|
|
|
@ -47,6 +47,7 @@ describe RemoteTheme do
|
|||
"about.json" => about_json,
|
||||
"desktop/desktop.scss" => scss_data,
|
||||
"scss/file.scss" => ".class1{color:red}",
|
||||
"scss/empty.scss" => "",
|
||||
"common/header.html" => "I AM HEADER",
|
||||
"common/random.html" => "I AM SILLY",
|
||||
"common/embedded.scss" => "EMBED",
|
||||
|
|
Loading…
Reference in New Issue