Skip to content

p137 - Extra parameter in method call? #12

Description

@mikbe

On page 137 of Chapter 5 should the self#authenticate method be changed from this:

def self.authenticate(username, password) 
  user = new(username, password)
  user.authenticate(password)
rescue Net::LDAP::LdapError => e 
  ActiveRecord::Base.logger.debug "!!! LDAP Error: #{e.message} !!!" 
  false
end

To this since the initialize method only takes one parameter?

def self.authenticate(username, password) 
  user = new(username) # <= Remove the password parameter
  user.authenticate(password)
rescue Net::LDAP::LdapError => e 
  ActiveRecord::Base.logger.debug "!!! LDAP Error: #{e.message} !!!" 
  false
end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions