diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-06-03 14:47:09 -0400 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2016-06-08 10:26:05 -0400 |
commit | ad83c3085513dd248b979d445e545e88a17c6ebc (patch) | |
tree | 8e8796d6900f0eed391be5a10d47e87771bd5b91 /app/models/snippet.rb | |
parent | 722211cddfaeba38f678cc523755af1ce645cb5a (diff) | |
download | gitlab-ce-ad83c3085513dd248b979d445e545e88a17c6ebc.tar.gz |
Remove `projects` inclusion in `notes_with_associations` to skip some unnecessary queries
`notes_with_associations` are used for `participant` declarations, but `Participable`
only really cares about the target entity project, and not the participants
projects.
`notes_with_associations` are also used in `Commit::has_been_reverted?` which
employs the reference extractor of the commit, so no references to the notes
projects are made there (`Mentionable::all_references` cares only about the
`author` and other `attr_mentionable`). A paralel situation occurs on
`Issue::referenced_merge_requests`.
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r-- | app/models/snippet.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb index 407697b745c..f8034cb5e6b 100644 --- a/app/models/snippet.rb +++ b/app/models/snippet.rb @@ -102,7 +102,7 @@ class Snippet < ActiveRecord::Base end def notes_with_associations - notes.includes(:author, :project) + notes.includes(:author) end class << self |