mirror of
https://github.com/System-End/identity-vault.git
synced 2026-04-19 22:05:07 +00:00
17 lines
544 B
Ruby
17 lines
544 B
Ruby
module ResemblanceNoticerEngine
|
|
TACTICS = [ NameSimilarity, DuplicateDocuments, EmailSubaddressing ]
|
|
|
|
def self.run(identity)
|
|
TACTICS.each do |tactic|
|
|
tactic.new(identity).run.each do |resemblance|
|
|
existing = identity.resemblances.find_by(
|
|
type: resemblance.class.name,
|
|
past_identity_id: resemblance.past_identity_id,
|
|
document_id: resemblance.document_id,
|
|
past_document_id: resemblance.past_document_id
|
|
)
|
|
resemblance.save! unless existing
|
|
end
|
|
end
|
|
end
|
|
end
|