perfomance fix

This commit is contained in:
gitlabhq 2011-11-15 04:09:07 -05:00
parent 762946995e
commit 6b9f221a27
3 changed files with 16 additions and 4 deletions

View file

@ -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