app/models/user.rb
# Returns true if the given token matches the digest
Returns true if the given token matches the digest
Returns true if the given token matches the digest
def authenticated?(attribute, token)
    digest = public_send("#{attribute}_digest")
    return false if digest.nil?
    BCrypt::Password.new(digest).is_password?(token)
  end
def authenticated? ( attribute , token ) digest = public_send ( "#{attribute}_digest" ) return false if digest . nil? BCrypt :: Password . new ( digest ) . is_password? ( token ) end
Returns true if the given token matches the digest
Returns true if the given token matches the digest
attribute
<not_specific>
token
<not_specific>