]> source.dussan.org Git - redmine.git/commitdiff
Remove ActiveRecord workaround (#26323).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 23 Jul 2017 16:13:25 +0000 (16:13 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 23 Jul 2017 16:13:25 +0000 (16:13 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@16869 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/query.rb

index fc6f97a6cd5b3effcae7ffd3c88a857509486231..b297a6973fcf9f80d09b208ebf26283b0b07aa0f 100644 (file)
@@ -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}