This website works better with JavaScript.
Home
Explore
Sign In
miteruzo
/
btrc-hub
Watch
1
Star
0
Fork
0
Code
Issues
38
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
#83
main
みてるぞ
7 hours ago
parent
da594e6637
commit
91a393d20c
1 changed files
with
12 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+12
-0
backend/lib/tasks/link_nico.rake
+ 12
- 0
backend/lib/tasks/link_nico.rake
View File
@@ -0,0 +1,12 @@
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
Write
Preview
Loading…
Cancel
Save