app/models/user.rb
# Returns true if the given token meets the digest in database.
Returns true if the given token meets the digest in database.
Returns true if the given token meets the digest in database .
def correct_token?(attribute, token)
    digest = self.send("#{attribute}_digest")
    return false if digest.nil?
    BCrypt::Password.new(digest).is_password?(token)
  end
def correct_token? ( attribute , token ) digest = self . send ( "#{attribute}_digest" ) return false if digest . nil? BCrypt :: Password . new ( digest ) . is_password? ( token ) end
Returns true if the given token meets the digest in database.
Returns true if the given token meets the digest in database .
attribute
token