Update Note to load notes in the right order

This commit is contained in:
Riyad Preukschas 2012-09-13 15:43:16 +02:00
parent 8b6dba749a
commit 6ffec9a298
2 changed files with 13 additions and 12 deletions

View file

@ -36,7 +36,7 @@ class Note < ActiveRecord::Base
scope :today, where("created_at >= :date", date: Date.today)
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 :fresh, order("created_at ASC")
scope :inc_author_project, includes(:project, :author)
scope :inc_author, includes(:author)