diff --git a/app/controllers/concerns/issuable_collections.rb b/app/controllers/concerns/issuable_collections.rb
index d7d781cbe721edffe32b4f0db661baa60aac97b9..85ae4985e58cf247a001d158ea80c262eadb97eb 100644
--- a/app/controllers/concerns/issuable_collections.rb
+++ b/app/controllers/concerns/issuable_collections.rb
@@ -28,13 +28,13 @@ module IssuableCollections
       downvotes = issuable_votes_count.find { |votes| votes.awardable_id == id && votes.downvote? }
       upvotes = issuable_votes_count.find { |votes| votes.awardable_id == id && votes.upvote? }
       notes = issuable_note_count.find { |notes| notes.noteable_id == id }
-      merge_requests = issuable_merge_requests_count.find { |mr| mr.issue_id == id }
+      merge_requests = issuable_merge_requests_count.find { |mr| mr.first == id }
 
       issuable_meta[id] = Issuable::IssuableMeta.new(
         upvotes.try(:count).to_i,
         downvotes.try(:count).to_i,
         notes.try(:count).to_i,
-        merge_requests.try(:count).to_i
+        merge_requests.try(:last).to_i
       )
     end
   end
diff --git a/app/models/merge_requests_closing_issues.rb b/app/models/merge_requests_closing_issues.rb
index 1ecdfd1dfdb277a774882314ddc792bae5b3db19..97210900bd5b544e1f97a8b1d706740c3b8daaff 100644
--- a/app/models/merge_requests_closing_issues.rb
+++ b/app/models/merge_requests_closing_issues.rb
@@ -7,9 +7,9 @@ class MergeRequestsClosingIssues < ActiveRecord::Base
 
   class << self
     def count_for_collection(ids)
-      select('issue_id', 'COUNT(*) as count').
-        group(:issue_id).
-        where(issue_id: ids)
+      group(:issue_id).
+      where(issue_id: ids).
+      pluck('issue_id', 'COUNT(*) as count')
     end
   end
 end