Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adds proper ordering to the queries.

  • Loading branch information...
commit 63c3af81d4ca79fe9e3a6841c24eacc6a38c58e6 1 parent d601264
@zlandau authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 patchwatch.rb
View
6 patchwatch.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.