Skip to content
Snippets Groups Projects
Commit 8237da0d authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Eager load note projects when viewing issues

parent d4832b03
No related branches found
No related tags found
1 merge request!1578Performance improvements when viewing individual issues
Loading
Loading
@@ -59,7 +59,10 @@ class Note < ActiveRecord::Base
scope :fresh, ->{ order(created_at: :asc, id: :asc) }
scope :inc_author_project, ->{ includes(:project, :author) }
scope :inc_author, ->{ includes(:author) }
scope :inc_associations, ->{ includes(:author, :noteable, :updated_by) }
scope :inc_associations, -> do
includes(:author, :noteable, :updated_by, :project)
end
 
serialize :st_diff
before_create :set_diff, if: ->(n) { n.line_code.present? }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment