Add new utility method for an issue to know whether it is being reassigned
This commit is contained in:
parent
f6035552e5
commit
2416e3cb19
2 changed files with 25 additions and 5 deletions
|
@ -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
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue