Project

General

Profile

Patch #26323 » outdated_code.diff

View differences:

app/models/query.rb (working copy)
934 934
  def grouped_query(&block)
935 935
    r = nil
936 936
    if grouped?
937
      begin
938
        # Rails3 will raise an (unexpected) RecordNotFound if there's only a nil group value
939
        r = yield base_group_scope
940
      rescue ActiveRecord::RecordNotFound
941
        r = {nil => yield(base_scope)}
942
      end
937
      r = yield base_group_scope
943 938
      c = group_by_column
944 939
      if c.is_a?(QueryCustomFieldColumn)
945 940
        r = r.keys.inject({}) {|h, k| h[c.custom_field.cast_value(k)] = r[k]; h}
(2-2/2)