summaryrefslogtreecommitdiffstats
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-08-08 21:28:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-08-08 21:28:07 +0000
commit0ce0b52342dfb5fd6c444609ef0370f7fdd28230 (patch)
tree6ef3d50bdc6f097c18273aa34a3d615fb13614ea /app/models/issue.rb
parentb90739878805d587e00b0112a65e04f921883b75 (diff)
downloadredmine-0ce0b52342dfb5fd6c444609ef0370f7fdd28230.tar.gz
redmine-0ce0b52342dfb5fd6c444609ef0370f7fdd28230.zip
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10179 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 6e0f3cc89..97c97e910 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -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?