Commit 8237da0d authored by Yorick Peterse's avatar Yorick Peterse

Eager load note projects when viewing issues

parent d4832b03
...@@ -59,7 +59,10 @@ class Note < ActiveRecord::Base ...@@ -59,7 +59,10 @@ class Note < ActiveRecord::Base
scope :fresh, ->{ order(created_at: :asc, id: :asc) } scope :fresh, ->{ order(created_at: :asc, id: :asc) }
scope :inc_author_project, ->{ includes(:project, :author) } scope :inc_author_project, ->{ includes(:project, :author) }
scope :inc_author, ->{ includes(: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 serialize :st_diff
before_create :set_diff, if: ->(n) { n.line_code.present? } before_create :set_diff, if: ->(n) { n.line_code.present? }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment