summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
authorgitlabhq <m@gitlabhq.com>2011-11-15 04:09:07 -0500
committergitlabhq <m@gitlabhq.com>2011-11-15 04:09:07 -0500
commit6b9f221a278ebe4a78f4f0b4d60f87659785595c (patch)
tree88dde06b7be81b2de6d83f136644b5eb4885d0b5 /app/models/note.rb
parent762946995ea9d477f00fea19e5040bf4dd437cb9 (diff)
downloadgitlab-ce-6b9f221a278ebe4a78f4f0b4d60f87659785595c.tar.gz
perfomance fix
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index c3c10639bf9..b256347abb1 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -30,6 +30,8 @@ class Note < ActiveRecord::Base
scope :last_week, where("created_at >= :date", :date => (Date.today - 7.days))
scope :since, lambda { |day| where("created_at >= :date", :date => (day)) }
scope :fresh, order("created_at DESC")
+ scope :inc_author_project, includes(:project, :author)
+ scope :inc_author, includes(:author)
mount_uploader :attachment, AttachmentUploader
end