diff options
author | Stan Hu <stanhu@gmail.com> | 2019-02-26 18:45:47 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-02-26 18:45:47 +0000 |
commit | 9812006568061f0afd8dfb146920e526877d4d9b (patch) | |
tree | e9537264f5b8c031b9c922d16c50e44a3e3f8fd1 /app | |
parent | 9b3a0de5ed44fdcdb01bd520ad8e0ec8e3ab7ea6 (diff) | |
parent | f4be2d4e1bd4ac456610c72862f20ff29b3820a8 (diff) | |
download | gitlab-ce-9812006568061f0afd8dfb146920e526877d4d9b.tar.gz |
Merge branch 'revert-48e6db0d' into 'master'
Revert "Merge branch '56726-fix-n+1-in-issues-and-merge-requests-api' into 'master'"
See merge request gitlab-org/gitlab-ce!25570
Diffstat (limited to 'app')
-rw-r--r-- | app/models/concerns/issuable.rb | 6 | ||||
-rw-r--r-- | app/models/issue.rb | 4 | ||||
-rw-r--r-- | app/views/shared/_issuable_meta_data.html.haml | 2 |
3 files changed, 4 insertions, 8 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index 670103bc3f3..429a63f83cc 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -28,7 +28,7 @@ module Issuable # This object is used to gather issuable meta data for displaying # upvotes, downvotes, notes and closing merge requests count for issues and merge requests # lists avoiding n+1 queries and improving performance. - IssuableMeta = Struct.new(:upvotes, :downvotes, :user_notes_count, :merge_requests_count) + IssuableMeta = Struct.new(:upvotes, :downvotes, :notes_count, :merge_requests_count) included do cache_markdown_field :title, pipeline: :single_line @@ -36,8 +36,8 @@ module Issuable redact_field :description - belongs_to :author, class_name: 'User' - belongs_to :updated_by, class_name: 'User' + belongs_to :author, class_name: "User" + belongs_to :updated_by, class_name: "User" belongs_to :last_edited_by, class_name: 'User' belongs_to :milestone diff --git a/app/models/issue.rb b/app/models/issue.rb index 071ad50fddc..0b46e949052 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -263,10 +263,6 @@ class Issue < ActiveRecord::Base end # rubocop: enable CodeReuse/ServiceClass - def merge_requests_count - merge_requests_closing_issues.count - end - private def ensure_metrics diff --git a/app/views/shared/_issuable_meta_data.html.haml b/app/views/shared/_issuable_meta_data.html.haml index 31a5370a5f8..6cc8c485666 100644 --- a/app/views/shared/_issuable_meta_data.html.haml +++ b/app/views/shared/_issuable_meta_data.html.haml @@ -1,4 +1,4 @@ -- note_count = @issuable_meta_data[issuable.id].user_notes_count +- note_count = @issuable_meta_data[issuable.id].notes_count - issue_votes = @issuable_meta_data[issuable.id] - upvotes, downvotes = issue_votes.upvotes, issue_votes.downvotes - issuable_url = @collection_type == "Issue" ? issue_path(issuable, anchor: 'notes') : merge_request_path(issuable, anchor: 'notes') |