|
1class BackfillCanonicalEmailsJob < ApplicationJob
|
|
|
|
|
- FeatureEnvy - refers to 'signature' more than self (maybe move it to another class?) » reek
- TooManyStatements - has approx 6 statements » reek
- Complexity 5 » saikuro
|
|
|
5 signatures = Signature.where(canonical_email: nil).batch(id).to_a
|
|
6 max_id = signatures.map(&:id).max
|
|
|
|
8 signatures.each do |signature|
|
|
9 next if signature.canonical_email?
|
|
|
|
|
|
12 signature.update_canonical_email
|
|
|
|
|
|
|
|
16 if Signature.exists?(canonical_email: nil)
|
|
17 self.class.perform_later(max_id)
|
|
|
|
|
|
|