Similarity in Postgres and Rails Using Trigrams
pganalyze.com
Similarity in Postgres and Rails Using Trigrams
1–10 of 10 posts
Re: Similarity in Postgres and Rails Using Trigrams
#2https://coderwall.com/p/vngr0a/simple-full-text-search-using...
EDIT: Found my answer
https://stackoverflow.com/questions/15884309/postgresql-full...
Re: Similarity in Postgres and Rails Using Trigrams
#3Re: Similarity in Postgres and Rails Using Trigrams
#4Re: Similarity in Postgres and Rails Using Trigrams
#5Re: Similarity in Postgres and Rails Using Trigrams
#6Re: Similarity in Postgres and Rails Using Trigrams
#7Re: Similarity in Postgres and Rails Using Trigrams
#8Oh wow, thanks to this post I learned that SQL has "order by ", the index of the column in the select list. That after 30 years of SQL...
Re: Similarity in Postgres and Rails Using Trigrams
#9Re: Similarity in Postgres and Rails Using Trigrams
#10I'm somewhat confused why the author didn't use bind variables since as far as I know the standard PostgreSQL adapters fully support them. Even if you trust that quote_string() will never have a vulnerability it's safer to not use string interpolation at all and it doesn't cost you anything.
This is a problem with `order` in Active Record in particular, where you can't pass in a bind variable the same way you'd expect it to work with `where`.
Therefore the slightly less elegant version that goes through quote_string. You could use bind variables by going directly to the pg driver, but I think there is no quick shorthand to do this in Active Record/Arel.