Code cleanup.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10179 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-08-08 21:28:07 +00:00
parent b907398788
commit 0ce0b52342
3 changed files with 19 additions and 6 deletions
+9
View File
@@ -587,6 +587,15 @@ class Issue < ActiveRecord::Base
end
end
# Returns a scope for journals that have an id greater than journal_id
def journals_after(journal_id)
scope = journals.reorder("#{Journal.table_name}.id ASC")
if journal_id.present?
scope = scope.where("#{Journal.table_name}.id > ?", journal_id.to_i)
end
scope
end
# Return true if the issue is closed, otherwise false
def closed?
self.status.is_closed?