app/models/effective/csv_importer.rb in effective_developer-0.2.13 vs app/models/effective/csv_importer.rb in effective_developer-0.2.14
- old
+ new
@@ -151,10 +151,10 @@
# Check for uniqueness
unique = 0
email = user.email
- while user.class.where(email: email).present?
+ while user.class.where(email: email).where.not(id: user.id).present?
pieces = user.email.split('@')
email = pieces.first + "+#{(unique += 1)}@" + pieces.last
end
user.email = email