このコミットが含まれているのは:
@@ -1,5 +1,10 @@
|
||||
class TheatrePostSelector
|
||||
Candidate = Struct.new(:post, :weight, :penalty, :tags, keyword_init: true)
|
||||
ELIGIBLE_POST_URL_CONDITION =
|
||||
["url LIKE '%nicovideo.jp%'",
|
||||
"url LIKE '%youtube.com/watch%'",
|
||||
"url LIKE '%youtu.be/%'"]
|
||||
.join(' OR ')
|
||||
|
||||
def initialize theatre:
|
||||
@theatre = theatre
|
||||
@@ -52,7 +57,7 @@ class TheatrePostSelector
|
||||
end
|
||||
|
||||
def eligible_posts
|
||||
posts = Post.where("url LIKE '%nicovideo.jp%'")
|
||||
posts = Post.where(ELIGIBLE_POST_URL_CONDITION)
|
||||
posts = posts.where.not(id: theatre.current_post_id) if theatre.current_post_id
|
||||
posts
|
||||
end
|
||||
|
||||
新しい課題から参照
ユーザをブロックする