In Ruby on Rails, for conditions, it's easy to make SQL-injection-proof queries:
:conditions => ["title = ?", title]
where title comes from the outside, from a web form or something like that.
But what if you are using SQL fragments in other parts of the query, like:
:select => "\"#{title}\" AS title" # I do have something like this in one instance
:joins => ["LEFT JOIN blah AS blah2 ON blah2.title = \"#{title}\""]
Is there a way to properly escape those strings?