Models Refactoring: Move methods to roles

This commit is contained in:
Dmitriy Zaporozhets 2012-06-07 15:44:57 +03:00
parent 98b8416647
commit 0a70aca3b1
20 changed files with 531 additions and 524 deletions

View file

@ -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
#