diff options
author | Sean McGivern <sean@gitlab.com> | 2016-05-30 17:53:08 +0100 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-06-06 11:59:49 -0500 |
commit | b28237b4d269e1e191597324769113ee4254d7c3 (patch) | |
tree | d792fbff9c9fe439bf5ad1d7ac27ead921f8a7d1 | |
parent | 6aea7666c336ba1dffa192249b391164d4b50d36 (diff) | |
download | gitlab-ce-b28237b4d269e1e191597324769113ee4254d7c3.tar.gz |
Don't try to count a relation with aliases
Work around ActiveRecord count and column aliases issue as described at:
<https://github.com/rails/rails/issues/15138#issuecomment-61325080>
AR doesn't promise that `#count` (which is called by `#any?`) will work
for relations using `#select`, which means we need a workaround instead.
-rw-r--r-- | app/views/shared/_issues.html.haml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/shared/_issues.html.haml b/app/views/shared/_issues.html.haml index 8ff9d4c1c7f..1150614c329 100644 --- a/app/views/shared/_issues.html.haml +++ b/app/views/shared/_issues.html.haml @@ -1,4 +1,4 @@ -- if @issues.any? +- if @issues.reorder('').any? - @issues.group_by(&:project).each do |group| .panel.panel-default.panel-small - project = group[0] |