@@ -176,18 +176,12 class Changeset < ActiveRecord::Base | |||
|
176 | 176 | |
|
177 | 177 | # Returns the previous changeset |
|
178 | 178 | def previous |
|
179 | @previous ||= Changeset.find(:first, | |
|
180 | :conditions => ['id < ? AND repository_id = ?', | |
|
181 | self.id, self.repository_id], | |
|
182 | :order => 'id DESC') | |
|
179 | @previous ||= Changeset.where(["id < ? AND repository_id = ?", id, repository_id]).order('id DESC').first | |
|
183 | 180 | end |
|
184 | 181 | |
|
185 | 182 | # Returns the next changeset |
|
186 | 183 | def next |
|
187 | @next ||= Changeset.find(:first, | |
|
188 | :conditions => ['id > ? AND repository_id = ?', | |
|
189 | self.id, self.repository_id], | |
|
190 | :order => 'id ASC') | |
|
184 | @next ||= Changeset.where(["id > ? AND repository_id = ?", id, repository_id]).order('id ASC').first | |
|
191 | 185 | end |
|
192 | 186 | |
|
193 | 187 | # Creates a new Change from it's common parameters |
General Comments 0
You need to be logged in to leave comments.
Login now