sdsykes / slim_scrooge

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

this gem does not work in production ENV #27

Open wyh770406 opened 10 years ago

wyh770406 commented 10 years ago

I got every query issue like as follow:

Mysql2::Error: Unknown column '162' in 'where clause': SELECT `brands`.`name`,`brands`.`e_name`,`brands`.`des`,`brands`.`created_at`,`brands`.`updated_at`,`brands`.`skus_count`,`brands`.`shops_count`,`brands`.`properties`,`brands`.`property_keys`,`brands`.`likes_count`,`brands`.`comments_count`,`brands`.`dispose_count`,`brands`.`url`,`brands`.`level`,`brands`.`rating`,`brands`.`address`,`brands`.`products`,`brands`.`tags`,`brands`.`phone_number`,`brands`.`avatar_id`,`brands`.`homepage`,`brands`.`weibo`,`brands`.`tmall`,`brands`.`weixin`,`brands`.`crawled_source`,`brands`.`introduction`,`brands`.`price_level`,`brands`.`brand_intro`,`brands`.`c_name`,`brands`.`low_price`,`brands`.`high_price`,`brands`.`shop_photo_id`,`brands`.`brand_photo_id`,`brands`.`wide_avatar_url`,`brands`.`category_id`,`brands`.`white_avatar_url`,`brands`.`black_avatar_url`,`brands`.`domain`,`brands`.`display_name`,`brands`.`wide_banner_url`,`brands`.`rails`,`brands`.`g`,`brands`.`migration`,`brands`.`add_wide_banner_url_to_brands`,`brands`.`currency`,`brands`.`priority`,`brands`.`brand_type`,`brands`.`brand_type_1`,`brands`.`brand_type_2`,`brands`.`brand_type_3`,`brands`.`img_quality`,`brands`.`last_updated`,`brands`.`id` FROM `brands` WHERE `id` IN (`162`,`1111`,`25`,`485`,`230`,`274`,`1501`,`1096`,`1007`,`141`,`68`,`493`,`21`,`1364`,`517`,`279`,`259`,`69`,`728`,`97`,`601`,`345`,`1486`,`1465`,`1494`,`210`,`424`,`472`,`1473`,`1053`,`1112`,`1207`,`339`,`6`,`184`,`80`,`188`,`127`,`1468`,`14`,`1331`,`165`,`1338`,`1020`,`62`,`269`,`1074`,`880`,`1088`,`1037`,`337`,`229`,`104`,`1078`,`748`,`437`,`1068`,`855`,`286`,`258`,`1069`,`440`,`186`,`2`,`91`,`1332`,`99`,`441`,`668`,`1233`,`93`,`1262`,`1348`,`1222`,`1220`,`1243`,`657`,`1042`,`1110`,`8`,`764`,`710`,`1187`,`1328`,`273`,`16`,`1073`,`114`,`73`,`1340`,`1084`,`663`,`275`,`1310`,`1275`,`1325`,`307`,`1205`,`458`,`1353`,`1271`,`180`,`1170`,`70`,`1231`,`1159`,`1218`,`1173`,`1221`,`204`,`1040`,`1162`,`362`,`74`,`1105`,`551`,`1437`,`909`,`918`,`1122`,`303`,`1214`,`1101`,`1216`,`185`,`439`,`299`,`37`,`1123`,`443`,`729`,`1268`,`67`,`705`,`27`,`603`,`63`,`190`,`300`,`1091`,`1165`,`509`,`59`,`1070`,`1135`,`1103`,`1100`,`1143`,`1046`,`1339`,`237`,`1282`,`1300`,`51`,`725`,`1230`,`1208`,`1136`,`547`,`78`,`1153`,`1257`,`919`,`181`,`691`,`1072`,`680`,`727`,`1083`,`411`,`1172`,`192`,`315`,`636`,`856`,`1204`,`177`,`101`,`1104`,`920`,`1094`,`1098`,`119`,`1488`,`151`,`703`,`206`,`1417`,`79`,`19`,`203`,`336`,`216`,`921`,`722`,`859`,`220`,`29`,`786`,`682`,`690`,`1336`,`1201`,`553`,`201`,`89`,`267`,`488`,`317`,`15`,`84`,`658`,`572`,`1082`,`1087`,`622`,`1489`,`66`,`65`,`86`,`598`,`308`,`233`,`1312`,`9`,`868`,`1180`,`496`,`665`,`446`,`217`,`117`,`17`,`1196`,`429`,`428`,`1496`,`113`,`492`,`41`,`586`,`95`,`821`,`302`,`40`,`297`,`720`,`1354`,`197`,`1209`,`1286`,`383`,`135`,`1156`,`18`,`1164`,`1158`,`1459`,`661`,`1256`,`32`,`1476`,`483`,`773`,`1189`,`1183`,`1119`,`1330`,`48`,`1239`,`1064`,`58`,`262`,`178`,`36`,`549`,`675`,`740`,`1292`,`1407`,`525`,`290`,`224`,`1106`,`353`,`106`,`1200`,`450`,`306`,`1149`,`24`,`120`,`1067`,`484`,`1066`,`1264`,`87`,`1065`,`571`,`464`,`730`,`1185`,`1035`,`1420`,`718`,`219`,`131`,`100`,`75`,`1293`,`542`,`1147`,`82`,`1224`,`1054`,`505`,`199`,`466`,`132`,`105`,`363`,`511`,`122`,`146`,`193`,`1500`,`125`,`1424`,`1358`,`1296`,`312`,`246`,`31`,`406`,`1125`,`153`,`1423`,`1193`,`155`,`102`,`1477`,`756`,`1472`,`221`,`1261`,`420`,`397`,`163`,`613`,`1140`,`207`,`573`,`616`,`257`,`49`,`287`,`1281`,`1270`,`118`,`1342`,`1186`,`1301`,`1273`,`1351`,`10`,`1093`,`1307`,`886`,`781`,`50`,`1288`,`272`,`208`,`1298`,`276`,`1474`,`990`,`1291`,`1409`,`1192`,`758`,`1299`,`1145`,`1202`,`1343`,`432`,`278`,`1210`,`385`,`512`,`1297`,`1304`,`1267`,`412`,`126`,`320`,`213`,`534`,`755`,`476`,`513`,`416`,`234`,`1029`,`1439`,`1285`,`1152`,`1227`,`387`,`1415`,`1335`,`677`,`1034`,`1090`,`231`,`38`,`1333`,`1274`,`223`,`681`,`1495`,`266`,`869`,`1118`,`1481`,`1435`,`1492`,`917`,`382`,`566`,`1109`,`1422`,`1290`,`111`,`1324`,`53`,`324`,`640`,`916`,`112`,`1163`,`313`,`77`,`1240`,`1089`,`588`,`96`,`1344`,`1386`,`1197`,`284`,`1116`,`1244`,`1195`,`1166`,`565`,`1132`,`1212`,`556`,`701`,`1411`,`116`,`1241`,`1309`,`44`,`430`,`557`,`245`,`1345`,`1278`,`1443`,`765`,`1406`,`1480`,`408`,`1311`,`1167`,`1134`,`1418`,`292`,`355`,`1436`,`1129`,`28`,`1346`,`1392`,`1246`,`858`,`1234`,`1128`,`1427`,`39`,`298`,`249`,`1155`,`401`,`1499`,`759`,`26`,`22`,`567`,`20`,`5`,`1095`,`607`,`1303`,`386`,`1421`,`1188`,`212`,`159`,`1133`,`564`,`578`,`357`,`175`,`1483`,`1141`,`1283`,`580`,`1276`,`1277`,`1413`,`1408`,`1396`,`325`,`853`,`137`,`56`,`124`,`319`,`1302`,`1461`,`293`,`1355`,`139`,`1356`,`1213`,`1370`,`417`,`1219`,`742`,`1217`,`1405`,`794`,`1388`,`295`,`709`,`335`,`1229`,`1350`,`1463`,`1272`,`1176`,`772`,`256`,`1493`,`508`,`1198`,`348`,`354`,`510`,`280`,`1182`,`1425`,`1404`,`1225`,`115`,`1175`,`226`,`554`,`3`,`1174`,`1121`,`1337`,`1206`,`314`,`945`,`1126`,`1482`,`396`,`43`,`807`,`1362`,`1369`,`1199`,`707`,`1260`,`590`,`1179`,`653`,`1265`,`1426`,`1395`,`1161`,`1010`,`792`,`625`,`1223`,`370`,`1255`,`1289`,`1259`,`1334`,`1117`,`1419`,`1347`,`1107`,`1401`,`1357`,`962`,`433`,`1360`,`1394`,`1279`,`1400`,`1127`,`717`,`1367`,`1416`,`1359`,`1363`,`283`,`599`,`1402`,`914`,`1365`,`1190`,`1368`,`583`,`861`,`1295`,`1484`,`1341`,`1058`,`329`,`1366`,`482`,`1160`,`1211`,`187`,`240`,`447`,`650`,`1294`,`1361`,`1475`,`1242`,`1235`,`1245`,`1491`,`1306`,`1305`,`1321`,`1308`,`1464`,`1284`)

Then if you remove `` from the ids, the query will work

sdsykes commented 10 years ago

Thanks. I'd accept a pull request but I'm not actively maintaining this software.