Created
June 18, 2011 19:54
-
-
Save trivektor/1033447 to your computer and use it in GitHub Desktop.
Escape single quotes to prepare for query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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