This commit is contained in:
@@ -45,20 +45,12 @@ namespace :nico do
|
||||
if current_tags != new_tags
|
||||
post.tags.destroy(post.tags.where(name: current_tags))
|
||||
new_tags.each do |name|
|
||||
post.tags << Tag.find_or_initialize_by(name:, category: 'nico')
|
||||
post.tags << Tag.find_or_initialize_by(name:) do |tag|
|
||||
tag.category = 'nico'
|
||||
end
|
||||
end
|
||||
if post.tags.size < 20
|
||||
name = 'タグ希望'
|
||||
post.tags.destroy(post.tags.find_by(name:) || [])
|
||||
post.tags << Tag.find_or_initialize_by(name:) { |tag|
|
||||
tag.category = 'meta'
|
||||
}
|
||||
end
|
||||
name = 'bot操作'
|
||||
post.tags.destroy(post.tags.find_by(name:) || [])
|
||||
post.tags << Tag.find_or_initialize_by(name:) { |tag|
|
||||
tag.category = 'meta'
|
||||
}
|
||||
post.tags << Tag.tagme if post.tags.size < 20 && post.tags.none?(Tag.tagme)
|
||||
post.tags << Tag.bot if post.tags.none?(Tag.bot)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user