diff options
author | micael.bergeron <micaelbergeron@gmail.com> | 2017-11-21 08:31:23 -0500 |
---|---|---|
committer | micael.bergeron <micaelbergeron@gmail.com> | 2017-11-21 08:31:23 -0500 |
commit | c900c21eef9235306d7d0da42b07aa2de346e263 (patch) | |
tree | 534592b7361aaa4160757be969e2435eb8c34679 /app/models/note.rb | |
parent | 9ed91479a7bbca1e420cd91a6322493d7ffda749 (diff) | |
download | gitlab-ce-c900c21eef9235306d7d0da42b07aa2de346e263.tar.gz |
add `#with_metadata` scope to remove a N+1 from the notes' API
Diffstat (limited to 'app/models/note.rb')
-rw-r--r-- | app/models/note.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index 4bbb54ba9bf..50c9caf8529 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -110,6 +110,7 @@ class Note < ActiveRecord::Base includes(:author, :noteable, :updated_by, project: [:project_members, { group: [:group_members] }]) end + scope :with_metadata, -> { includes(:system_note_metadata) } after_initialize :ensure_discussion_id before_validation :nullify_blank_type, :nullify_blank_line_code |