Skip to content

Instantly share code, notes, and snippets.

@trivektor
Created June 18, 2011 19:54
Show Gist options
  • Save trivektor/1033447 to your computer and use it in GitHub Desktop.
Save trivektor/1033447 to your computer and use it in GitHub Desktop.
Escape single quotes to prepare for query
class String
def escape_single_quotes
self.gsub(/'/, "\\\\'")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment