You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- namespace :nico do
- desc 'ニコタグ連携'
- task link: :environment do
- Post.find_each do |post|
- tags = post.tags.where(category: 'nico')
- tags.each do |tag|
- post.tags.concat(tag.linked_tags) if tag.linked_tags.present?
- end
- post.tags = post.tags.to_a.uniq
- end
- end
- end
|