コミットを比較
5 コミット
main
...
250ee3f011
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
| 250ee3f011 | |||
| e5048dc9b3 | |||
| a59ec2b417 | |||
| eef12a68d1 | |||
| 9f10bc8467 |
@@ -73,6 +73,10 @@ class Tag < ApplicationRecord
|
|||||||
@bot ||= find_or_create_by_tag_name!('bot操作', category: :meta)
|
@bot ||= find_or_create_by_tag_name!('bot操作', category: :meta)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.no_deerjikist
|
||||||
|
@no_deerjikist ||= find_or_create_by_tag_name!('ニジラー情報不詳', category: :meta)
|
||||||
|
end
|
||||||
|
|
||||||
def self.video
|
def self.video
|
||||||
@video ||= find_or_create_by_tag_name!('動画', category: :meta)
|
@video ||= find_or_create_by_tag_name!('動画', category: :meta)
|
||||||
end
|
end
|
||||||
@@ -97,6 +101,7 @@ class Tag < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
tags << Tag.tagme if with_tagme && tags.size < 10 && tags.none?(Tag.tagme)
|
tags << Tag.tagme if with_tagme && tags.size < 10 && tags.none?(Tag.tagme)
|
||||||
|
tags << Tag.no_deerjikist if tags.all? { |t| t.category != 'deerjikist' }
|
||||||
tags.uniq(&:id)
|
tags.uniq(&:id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ namespace :nico do
|
|||||||
desc 'ニコニコ DB 同期'
|
desc 'ニコニコ DB 同期'
|
||||||
task sync: :environment do
|
task sync: :environment do
|
||||||
require 'json'
|
require 'json'
|
||||||
require 'open3'
|
|
||||||
require 'open-uri'
|
|
||||||
require 'nokogiri'
|
require 'nokogiri'
|
||||||
|
require 'open-uri'
|
||||||
|
require 'open3'
|
||||||
require 'set'
|
require 'set'
|
||||||
require 'time'
|
require 'time'
|
||||||
|
|
||||||
@@ -117,6 +117,9 @@ namespace :nico do
|
|||||||
if kept_non_nico_ids.to_set != desired_non_nico_ids.to_set
|
if kept_non_nico_ids.to_set != desired_non_nico_ids.to_set
|
||||||
desired_all_ids << Tag.bot.id
|
desired_all_ids << Tag.bot.id
|
||||||
end
|
end
|
||||||
|
unless Tag.where(id: desired_all_ids).where(category: 'deerjikist').exists?
|
||||||
|
desired_all_ids << Tag.no_deerjikist.id
|
||||||
|
end
|
||||||
desired_all_ids.uniq!
|
desired_all_ids.uniq!
|
||||||
|
|
||||||
sync_post_tags!(post, desired_all_ids, current_ids: kept_ids)
|
sync_post_tags!(post, desired_all_ids, current_ids: kept_ids)
|
||||||
|
|||||||
新しい課題から参照
ユーザをブロックする