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 = { }
|
||||
|
||||
@@ -16,6 +16,7 @@ class TagVersionRecorder < VersionRecorder
|
||||
def snapshot_attributes
|
||||
{ name: @record.name,
|
||||
category: @record.category,
|
||||
deprecated_at: @record.deprecated_at,
|
||||
aliases: @record.snapshot_aliases.join(' '),
|
||||
parent_tag_ids: @record.snapshot_parent_tag_ids.join(' ') }
|
||||
end
|
||||
|
||||
新しい課題から参照
ユーザをブロックする