Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9936 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
7a529b24ee
commit
56666a41b8
|
@ -176,18 +176,12 @@ class Changeset < ActiveRecord::Base
|
||||||
|
|
||||||
# Returns the previous changeset
|
# Returns the previous changeset
|
||||||
def previous
|
def previous
|
||||||
@previous ||= Changeset.find(:first,
|
@previous ||= Changeset.where(["id < ? AND repository_id = ?", id, repository_id]).order('id DESC').first
|
||||||
:conditions => ['id < ? AND repository_id = ?',
|
|
||||||
self.id, self.repository_id],
|
|
||||||
:order => 'id DESC')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the next changeset
|
# Returns the next changeset
|
||||||
def next
|
def next
|
||||||
@next ||= Changeset.find(:first,
|
@next ||= Changeset.where(["id > ? AND repository_id = ?", id, repository_id]).order('id ASC').first
|
||||||
:conditions => ['id > ? AND repository_id = ?',
|
|
||||||
self.id, self.repository_id],
|
|
||||||
:order => 'id ASC')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Creates a new Change from it's common parameters
|
# Creates a new Change from it's common parameters
|
||||||
|
|
Loading…
Reference in New Issue