Don't migrate categories that do not exists anymore.

This commit is contained in:
Guo Xiang Tan 2017-10-03 16:33:07 +08:00
parent 1a3928b803
commit 5cfa7f913d
1 changed files with 2 additions and 0 deletions

View File

@ -44,6 +44,8 @@ module Jobs
row.key.to_i
end
next if !category_id.nil? && !Category.exists?(id: category_id)
valid_tags = []
valid_tags = Tag.where(name: rule[:tags]).pluck(:name) if rule[:tags]