<% if @custom_error %>
<%= @custom_error %>
<% end %> <% @query = CostQuery.new @query.filter :project_id, :value => [1,2] @query.group_by :tweek @query.column :tweek @query.row :user_id @query.row :project_id %>

Die (schöne) "Tabelle":

<% data = @query.walk(:row_first) do |current, sub| if current.column? if @was_column next sub.join else @was_column = true next sub end end field = "#{current.type}, #{@was_column.inspect}: #{current.fields.inspect}" if sub.blank? [field % 1] else if @was_column @was_column = false [(field % 1) << sub.join] else first, *rest = sub.flatten size = rest.size + 1 first = (field % size) << first [first, *rest] end end end %> <% data.flatten.each do |line| %> <%= line %> <% end %>
query chain:
<% max = 20 %> Result (row):
<% @row.recursive_each_with_level do |l, r| %>
    <%= "#{'|  '*l}#{r.class} (#{r.fields}) # size:#{r.size}" %><% max -=1; break if max <= 0; end %>
    ...
  
<% max = 20 %> Result (column):
<% @column.recursive_each_with_level do |l, r| %>
    <%= "#{'|  '*l}#{r.class} (#{r.fields}) # size:#{r.size}" %><% max -=1; break if max <= 0; end %>
    ...
  
SQL statement:
<%= @query.sql_statement.to_s %>