Skip to content

Instantly share code, notes, and snippets.

@ybart
Created June 26, 2011 15:51
Show Gist options
  • Save ybart/1047725 to your computer and use it in GitHub Desktop.
Save ybart/1047725 to your computer and use it in GitHub Desktop.
<% charts_js %>
<section id="content" class="body">
<table class="data">
<%= @clips.count %>
<thead><tr>
<th><%= sort_link 'Title', :title %></th>
<th><%= sort_link 'Entrée', :in %></th>
<th><%= sort_link 'Classique', :gold %></th>
<th><%= sort_link 'Top 10', :top10_count %></th>
<th><%= sort_link 'Top 20', :top20_count %></th>
</tr></thead>
<tbody>
<% @clips.each do |clip| %>
<tr class="<%= cycle('odd', 'even') %>">
<td><%= "#{clip.artist.name} - #{clip.title}" %></td>
<td><%= clip.rankings.first.jtop_id %></td>
<td><%= clip.rankings.last.jtop_id %></td>
<td><%= clip.top10_count %></td>
<td><%= clip.top20_count %></td>
</tr>
<% end %>
</tbody>
</table>
</section>
@ybart
Copy link
Author

ybart commented Jun 26, 2011

 ~   SQL (0.339ms)  SET backslash_quote = off
 ~   SQL (0.274ms)  SET standard_conforming_strings = on
 ~   SQL (0.129ms)  SET client_min_messages = warning
 ~   SQL (2.032ms)  SELECT COUNT(*) FROM "clips" WHERE ("top10_count" >= 1 AND "top20_count" >= 7)
 ~   SQL (1.340ms)  SELECT "id", "title", "featuring", "top10_count", "top20_count", "artist_id" FROM "clips" WHERE ("top10_count" >= 1 AND "top20_count" >= 7) ORDER BY "top20_count"
 ~   SQL (1.056ms)  SELECT "id", "name" FROM "artists" WHERE "id" IN (138, 8, 143, 292, 217, 279, 263, 10, 226, 150, 85, 166, 139, 260, 416, 253, 225, 248, 154, 42, 406, 3, 424, 101, 259, 341, 401, 7, 60, 314, 215, 156, 348, 198, 184, 357, 369, 368, 358, 91, 21, 106, 26, 350, 206, 51, 345, 344, 2, 327, 230, 27, 239, 318, 309, 136, 87, 265, 83, 58, 90, 244, 81, 16, 402, 80, 319, 377, 15, 133, 261, 174, 50, 5, 132, 4, 157, 89, 88, 1, 12, 56, 201, 45, 11, 6, 94, 114, 197, 23, 9, 19) ORDER BY "id"
 ~   SQL (43.582ms)  SELECT "id", "rank", "progress", "vote_count", "vote_score", "pal_count", "pal_score", "clip_id", "jtop_id", "prev_jtop_id" FROM "rankings" WHERE "clip_id" IN (631, 786, 780, 771, 569, 575, 581, 734, 704, 698, 602, 604, 1223, 611, 697, 1191, 627, 689, 1163, 680, 668, 672, 1190, 1181, 1180, 1179, 1177, 1176, 1175, 1138, 1137, 1136, 1246, 1128, 1127, 1126, 1106, 1097, 1096, 125, 140, 1089, 1081, 1075, 1073, 203, 263, 1061, 1055, 1054, 1053, 1051, 1049, 1044, 218, 1043, 1030, 1027, 1026, 1018, 1012, 1011, 1010, 287, 1009, 1002, 300, 1001, 989, 309, 987, 986, 1215, 1207, 985, 983, 982, 346, 975, 965, 963, 951, 950, 949, 945, 944, 943, 939, 1224, 934, 928, 397, 915, 903, 404, 897, 896, 891, 411, 413, 886, 885, 423, 880, 878, 877, 876, 871, 865, 453, 864, 860, 854, 853, 852, 847, 838, 833, 825, 820, 816, 530, 809, 532, 808, 799, 798, 797, 794, 791, 790, 787, 556, 1178, 596, 1088, 688, 663, 81, 1017, 1129, 785, 580, 437, 966, 1063, 620, 872, 694, 732, 204, 82, 323, 325, 388, 610, 619, 642, 649, 691, 763, 817, 861, 984, 1074, 1080, 421, 401, 887, 516, 918, 432, 362, 1130, 473, 354, 299, 86, 410, 733, 537, 650, 690, 810, 232, 450, 433, 393, 384, 364, 318, 269, 19, 24, 329, 538, 3, 5, 342, 347, 270, 599, 465, 4, 457, 165, 2, 407, 359, 209, 212, 213, 489, 224, 341, 1, 13, 308, 284, 560, 106, 482, 452, 123, 217, 250, 254, 294, 93, 520, 529, 531, 85, 12, 568, 665, 600, 200, 601, 466, 622, 451, 427, 687, 208, 555, 372, 541, 366, 561, 545, 304, 207, 365, 395, 187, 616, 539, 589, 549, 416, 312, 386, 9, 11, 251, 637, 194, 211, 78, 77, 403, 236, 87, 483, 7, 6, 567, 443, 115, 10, 542, 409, 174, 21, 358, 508, 210) ORDER BY "id"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment