Models Refactoring: Move methods to roles
This commit is contained in:
parent
98b8416647
commit
0a70aca3b1
20 changed files with 531 additions and 524 deletions
|
@ -1,4 +1,6 @@
|
|||
class Issue < ActiveRecord::Base
|
||||
include Upvote
|
||||
|
||||
belongs_to :project
|
||||
belongs_to :milestone
|
||||
belongs_to :author, :class_name => "User"
|
||||
|
@ -53,11 +55,6 @@ 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
|
||||
end
|
||||
# == Schema Information
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue