Commit 1d72b52c authored by jplang's avatar jplang

Remove ActiveRecord workaround (#26323).

git-svn-id: https://svn.redmine.org/redmine/trunk@16869 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 732f74fa
......@@ -934,12 +934,7 @@ class Query < ActiveRecord::Base
def grouped_query(&block)
r = nil
if grouped?
begin
# Rails3 will raise an (unexpected) RecordNotFound if there's only a nil group value
r = yield base_group_scope
rescue ActiveRecord::RecordNotFound
r = {nil => yield(base_scope)}
end
r = yield base_group_scope
c = group_by_column
if c.is_a?(QueryCustomFieldColumn)
r = r.keys.inject({}) {|h, k| h[c.custom_field.cast_value(k)] = r[k]; h}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment