Filter out invalid tags when migrating.

This commit is contained in:
Guo Xiang Tan 2017-09-28 17:27:20 +08:00
parent 435b1cc9b5
commit b33fb671f2
1 changed files with 4 additions and 1 deletions

View File

@ -43,11 +43,14 @@ module Jobs
row.key.to_i row.key.to_i
end end
valid_tags = []
valid_tags = Tag.where(name: rule[:tags]).pluck(:name) if rule[:tags]
rows << { rows << {
category_id: category_id, category_id: category_id,
channel: rule[:channel], channel: rule[:channel],
filter: rule[:filter], filter: rule[:filter],
tags: rule[:tags] tags: valid_tags
} }
end end
end end