Permalink
Browse files

Support mysql2 in SQL queries.

  • Loading branch information...
oggy committed May 1, 2011
1 parent 6dcd889 commit f74d0563a68ed4fb662ea0824ec443ad77387e09
@@ -13,8 +13,14 @@
<table class="sortable">
<thead>
<tr>
- <% result.fetch_fields.each do |field| %>
- <th><%= field.name.upcase %></th>
+ <% if defined?(Mysql2) %>
+ <% result.fields.each do |field| %>
+ <th><%= field.upcase %></th>
+ <% end %>
+ <% else %>
+ <% result.fetch_fields.each do |field| %>
+ <th><%= field.name.upcase %></th>
+ <% end %>
<% end %>
</tr>
</thead>
@@ -13,10 +13,16 @@
<table class="sortable">
<thead>
<tr>
- <% result.fetch_fields.each do |field| %>
- <th><%= field.name.upcase %></th>
+ <% if defined?(Mysql2) %>
+ <% result.fields.each do |field| %>
+ <th><%= field.upcase %></th>
+ <% end %>
+ <% else %>
+ <% result.fetch_fields.each do |field| %>
+ <th><%= field.name.upcase %></th>
+ <% end %>
<% end %>
- </tr>
+ </tr>
</thead>
<tbody>
<% i = 1 %>
@@ -13,8 +13,14 @@
<table class="sortable">
<thead>
<tr>
- <% result.fetch_fields.each do |field| %>
- <th><%= field.name.upcase %></th>
+ <% if defined?(Mysql2) %>
+ <% result.fields.each do |field| %>
+ <th><%= field.upcase %></th>
+ <% end %>
+ <% else %>
+ <% result.fetch_fields.each do |field| %>
+ <th><%= field.name.upcase %></th>
+ <% end %>
<% end %>
</tr>
</thead>

0 comments on commit f74d056

Please sign in to comment.