Permalink
Browse files

Adds proper ordering to the queries.

  • Loading branch information...
1 parent d601264 commit 63c3af81d4ca79fe9e3a6841c24eacc6a38c58e6 @zlandau committed Apr 8, 2006
Showing with 4 additions and 2 deletions.
  1. +4 −2 patchwatch.rb
View
@@ -21,7 +21,7 @@ def self.schema(&block)
class Patch < Base
belongs_to :author
belongs_to :state
- has_many :comments
+ has_many :comments, :order => 'date ASC'
has_and_belongs_to_many :branches
validates_uniqueness_of :msgid
end
@@ -104,7 +104,9 @@ module PatchWatch::Controllers
class Index < R '/'
def get
@search_term = input.q
- @patches = Patch.find :all, :conditions => ['name LIKE ?', "%#{input.q}%" || "%"]
+ @patches = Patch.find :all,
+ :conditions => ['name LIKE ?', "%#{input.q}%" || "%"],
+ :order => 'date DESC'
render :index
end
end

0 comments on commit 63c3af8

Please sign in to comment.