app/mailers/user_mailer.rb
# Compute an array of valid destination email addresses, given a
# new "email" value and the changes (which might
# include the original email value).
# Require that email addresses are non-null and include '@', and de-dup.
Compute an array of valid destination email addresses, given a
new "email" value and the changes (which might
include the original email value).
Require that email addresses are non-null and include '@', and de-dup.
Compute an array of valid destination email addresses given a new " email " value and the changes ( which might include the original email value ) . Require that email addresses are non - null and include ' @ ' and de - dup .
def find_destinations(email, changes)
    destination = []
    destination << email if email&.include?('@')
    if changes && changes['email']
      old_email = changes['email'][0]
      destination << old_email if old_email&.include?('@')
    end
    destination.uniq
  end
def find_destinations ( email , changes ) destination = [ ] destination << email if email &. include? ( '@' ) if changes && changes [ 'email' ] old_email = changes [ 'email' ] [ 0 ] destination << old_email if old_email &. include? ( '@' ) end destination . uniq end
Compute an array of valid destination email addresses, given a
new "email" value and the changes (which might
include the original email value).
Compute an array of valid destination email addresses given a new " email " value and the changes ( which might include the original email value ) .
email
<not_specific>
changes
<not_specific>