Restore DBD::MySQL::Database#quote method

mai 29th, 2012 | Filed under Programming

For whatever reason, Ruby DBI and DBD have axed the quote method from their midst, breaking compatibility with previous versions. Sadly I couldn’t find any clues as to why it was removed (actually, bluntly commented out).

Fortunately I was able to unearth some hints how to restore this method and with an added fix to NilClass, the result seems to be working fine:

Just place this in some file and require it in your code.


Be Sociable, Share!
No comments yet.