I am having trouble finding docs on the Rails way of doing something like:
email = "[email protected]"
results = Contact.select(:id, :email, "levenshtein(email, '#{email}',1,1,6) AS confidence").order("levenshtein(email, '#{email}',1,1,6)")
I know with where clause we can use ? instead of using #{email}, but having trouble getting that to work with SELECT and ORDER. Any help would be appreciated!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…