@@ -147,23 +147,29 class Changeset < ActiveRecord::Base | |||
|
147 | 147 | "r#{revision}" |
|
148 | 148 | end |
|
149 | 149 | end |
|
150 | ||
|
150 | ||
|
151 | 151 | # Returns the previous changeset |
|
152 | 152 | def previous |
|
153 | @previous ||= Changeset.find(:first, :conditions => ['id < ? AND repository_id = ?', self.id, self.repository_id], :order => 'id DESC') | |
|
153 | @previous ||= Changeset.find(:first, | |
|
154 | :conditions => ['id < ? AND repository_id = ?', | |
|
155 | self.id, self.repository_id], | |
|
156 | :order => 'id DESC') | |
|
154 | 157 | end |
|
155 | 158 | |
|
156 | 159 | # Returns the next changeset |
|
157 | 160 | def next |
|
158 | @next ||= Changeset.find(:first, :conditions => ['id > ? AND repository_id = ?', self.id, self.repository_id], :order => 'id ASC') | |
|
161 | @next ||= Changeset.find(:first, | |
|
162 | :conditions => ['id > ? AND repository_id = ?', | |
|
163 | self.id, self.repository_id], | |
|
164 | :order => 'id ASC') | |
|
159 | 165 | end |
|
160 | ||
|
166 | ||
|
161 | 167 | # Creates a new Change from it's common parameters |
|
162 | 168 | def create_change(change) |
|
163 | Change.create(:changeset => self, | |
|
164 | :action => change[:action], | |
|
165 | :path => change[:path], | |
|
166 | :from_path => change[:from_path], | |
|
169 | Change.create(:changeset => self, | |
|
170 | :action => change[:action], | |
|
171 | :path => change[:path], | |
|
172 | :from_path => change[:from_path], | |
|
167 | 173 | :from_revision => change[:from_revision]) |
|
168 | 174 | end |
|
169 | 175 |
General Comments 0
You need to be logged in to leave comments.
Login now