lib/devise/multi_email/parent_model_manager.rb
def change_primary_email_to(new_email, options = {})
        # mark none as primary when set to nil
        if new_email.nil?
          filtered_emails.each { |item| item.primary = false }

        # select or build an email record
        else
          record = find_or_build_for_email(new_email)

          if record.try(:confirmed?) || primary_email_record.nil? || options[:allow_unconfirmed]
            set_primary_record_to(record, options)
          end
        end

        record
      end
# :allow_unconfirmed option sets this email record to primary
# :skip_confirmations option confirms this email record (without saving)
# @see `set_primary_record_to`
:allow_unconfirmed option sets this email record to primary
:skip_confirmations option confirms this email record (without saving)
: allow_unconfirmed option sets this email record to primary : skip_confirmations option confirms this email record ( without saving )
def change_primary_email_to(new_email, options = {})
        if new_email.nil?
          filtered_emails.each { |item| item.primary = false }
        else
          record = find_or_build_for_email(new_email)
          if record.try(:confirmed?) || primary_email_record.nil? || options[:allow_unconfirmed]
            set_primary_record_to(record, options)
          end
        end
        record
      end
def change_primary_email_to ( new_email , options = { } ) if new_email . nil? filtered_emails . each { | item | item . primary = false } else record = find_or_build_for_email ( new_email ) if record . try ( :confirmed? ) || primary_email_record . nil? || options [ :allow_unconfirmed ] set_primary_record_to ( record , options ) end end record end
:allow_unconfirmed option sets this email record to primary
:skip_confirmations option confirms this email record (without saving)
: allow_unconfirmed option sets this email record to primary : skip_confirmations option confirms this email record ( without saving )
# mark none as primary when set to nil # select or build an email record
new_email
options
see
None