From: Peter Rabbitson <ribasushi@cpan.org>
Date: Sun, 28 Jun 2009 12:38:36 +0000 (+0000)
Subject: Normalize group_by
X-Git-Tag: v0.08108~37^2~15
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f9cb03b78dcca1571c73380ae5edcd78acd21bae;p=dbsrgits%2FDBIx-Class.git

Normalize group_by
---

diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm
index b012e03..90a3f0d 100644
--- a/lib/DBIx/Class/ResultSet.pm
+++ b/lib/DBIx/Class/ResultSet.pm
@@ -2703,6 +2703,10 @@ sub _resolved_attrs {
     $attrs->{order_by} = [];
   }
 
+  if ($attrs->{group_by} and ! ref $attrs->{group_by}) {
+    $attrs->{group_by} = [ $attrs->{group_by} ];
+  }
+
   # If the order_by is otherwise empty - we will use this for TOP limit
   # emulation and the like.
   # Although this is needed only if the order_by is not defined, it is