module DeviseBasecamper::Confirmable::ClassMethods

Public Instance Methods

confirm_with_login?(attributes={}) click to toggle source
# File lib/devise-basecamper/confirmable.rb, line 23
def confirm_with_login?(attributes={})
  if attributes.any?
    attributes.include?( basecamper[:login_attribute] ) && confirmation_keys.include?( basecamper[:login_attribute] )
  else
    reset_password_keys.include?( basecamper[:login_attribute] )
  end
end
send_confirmation_instructions(attributes={}) click to toggle source

Override for password resets ——————-

# File lib/devise-basecamper/confirmable.rb, line 7
def send_confirmation_instructions(attributes={})
  if confirm_with_login?
    subdomain_resource                      = find_resource_by_subdomain(attributes)
    attributes[ basecamper[:scope_field] ]  = subdomain_resource.nil? ? nil : subdomain_resource.id
    recoverable                             = find_for_authentication_with_login(reset_password_keys, attributes, :not_found)
  else
    recoverable = find_or_initialize_with_errors(reset_password_keys, attributes, :not_found)
  end

  ## Now that we have found the recoverable, we are going to call the
  ## send_reset_password_instructions on the specific recoverable
  ##
  recoverable.send_confirmation_instructions if recoverable.persisted?
  recoverable
end