This is an example of a query ActiveRecord can not generate (but I wish it would):
PostSearch.find_by_sql("
select
ps.*
from
post_search ps join posts p on p.id=ps.id
where
post_search.id <> #{self.id} and
abs(length(body_excerpt)-length(body_excerpt))<#{max_diff}
order by
duplicate_post_id desc
"
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment