sdsykes / slim_scrooge

SlimScrooge heavily optimises your database interactions
313 stars 25 forks source link

Fix for quoted SQL arguments #26

Open bradphilips opened 11 years ago

bradphilips commented 11 years ago

This is a fix for issue #17 (https://github.com/sdsykes/slim_scrooge/issues/17). It looks like when using PostgreSQL the quote_column_name was quoting the args instead of the column names (http://apidock.com/rails/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/quote_column_name) This seems to work for me (tested with our barkudo app) but I also didn't have the appropriate setup to be able to run the tests. Let me know if this works with a mysql/other adapter setups as well. Thanks!

BTW, I just tried using v 1.0.13 against a PostgreSQL db. It crashes like this "PG::Error: ERROR: column "1" does not exist LINE 1: ...erride_fb_pic","users"."id" FROM "users" WHERE "id" IN ("1")" That "1" is an integer and shouldn't have quotes around it.