Module: Spree::PersonalDataMatching

Extended by:
ActiveSupport::Concern
Included in:
Customers::Anonymize, Customers::DataExport
Defined in:
app/models/concerns/spree/personal_data_matching.rb

Overview

Finds the rows that belong to one person across the tables that record an email without owning a customer.

Shared by the access export and the erasure workflow so the two cannot disagree about which rows are about this person — an address one of them reaches and the other does not is either data disclosed but not erased, or erased but never disclosed.

Matching is case-insensitive because the models disagree: a customer's and an order's address keeps the casing it was typed in, while a newsletter address is stored downcased. Someone who checks out as [email protected] and subscribes as [email protected] is one person, and an exact comparison would leave the guest checkout behind — still holding their name, street and IP address — after they asked to be forgotten.