Filter out invalid tags when migrating.
This commit is contained in:
parent
435b1cc9b5
commit
b33fb671f2
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue