Add new utility method for an issue to know whether it is being reassigned

This commit is contained in:
Robb Kidd 2012-05-20 14:15:13 -04:00
parent f6035552e5
commit 2416e3cb19
2 changed files with 25 additions and 5 deletions

View file

@ -27,7 +27,7 @@ class Issue < ActiveRecord::Base
validates :title,
:presence => true,
:length => { :within => 0..255 }
validates :description,
:length => { :within => 0..2000 }
@ -55,6 +55,15 @@ class Issue < ActiveRecord::Base
def new?
today? && created_at == updated_at
end
# Return the number of +1 comments (upvotes)
def upvotes
notes.select(&:upvote?).size
end
def is_being_reassigned?
assignee_id_changed?
end
end
# == Schema Information
#