Method not available on this version
This method is only available on newer versions.
The first available version (v7.2.3) is shown here.
find_by_token_for(purpose, token)
public
Finds a record using a given token for a predefined
purpose. Returns nil if the token is invalid or the
record was not found.
# File activerecord/lib/active_record/token_for.rb, line 41
def find_by_token_for(purpose, token)
raise UnknownPrimaryKey.new(self) unless model.primary_key
model.token_definitions.fetch(purpose).resolve_token(token) { |id| find_by(model.primary_key => id) }
end