diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-04-09 23:21:04 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-04-09 23:21:04 +0000 |
commit | f31df6c02fa9e755d10f6597ac4c17ad97136841 (patch) | |
tree | f9d76ff53ee076fec8752250f09cf5035e4df994 /app/models/changeset.rb | |
parent | 6536c53e09735f81b11eeb70a744a94c48e0c977 (diff) | |
download | redmine-f31df6c02fa9e755d10f6597ac4c17ad97136841.tar.gz redmine-f31df6c02fa9e755d10f6597ac4c17ad97136841.zip |
scm: code clean up app/models/changeset.rb.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5374 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/changeset.rb')
-rw-r--r-- | app/models/changeset.rb | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/app/models/changeset.rb b/app/models/changeset.rb index 869e9bad9..b01809024 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -147,23 +147,29 @@ class Changeset < ActiveRecord::Base "r#{revision}" end end - + # Returns the previous changeset def previous - @previous ||= Changeset.find(:first, :conditions => ['id < ? AND repository_id = ?', self.id, self.repository_id], :order => 'id DESC') + @previous ||= Changeset.find(:first, + :conditions => ['id < ? AND repository_id = ?', + self.id, self.repository_id], + :order => 'id DESC') end # Returns the next changeset def next - @next ||= Changeset.find(:first, :conditions => ['id > ? AND repository_id = ?', self.id, self.repository_id], :order => 'id ASC') + @next ||= Changeset.find(:first, + :conditions => ['id > ? AND repository_id = ?', + self.id, self.repository_id], + :order => 'id ASC') end - + # Creates a new Change from it's common parameters def create_change(change) - Change.create(:changeset => self, - :action => change[:action], - :path => change[:path], - :from_path => change[:from_path], + Change.create(:changeset => self, + :action => change[:action], + :path => change[:path], + :from_path => change[:from_path], :from_revision => change[:from_revision]) end |