Reviewed-on: #379 Co-authored-by: miteruzo <miteruzo@naver.com> Co-committed-by: miteruzo <miteruzo@naver.com>
このコミットはPull リクエスト #379 でマージされました.
このコミットが含まれているのは:
@@ -1,6 +1,6 @@
|
||||
module Similarity
|
||||
class Calc
|
||||
def self.call model, tgt
|
||||
def self.call model, tgt, scope: nil
|
||||
similarity_model = "#{ model.name }Similarity".constantize
|
||||
|
||||
# 最大保存件数
|
||||
@@ -8,7 +8,8 @@ module Similarity
|
||||
|
||||
similarity_model.delete_all
|
||||
|
||||
posts = model.includes(tgt).select(:id).to_a
|
||||
scope ||= model.all
|
||||
posts = scope.includes(tgt).select(:id).to_a
|
||||
|
||||
tag_ids = { }
|
||||
tag_cnts = { }
|
||||
|
||||
新しい課題から参照
ユーザをブロックする