Create events on comments and milestone
This commit is contained in:
parent
190e483fb4
commit
678e5355a3
7 changed files with 40 additions and 3 deletions
|
@ -63,7 +63,7 @@ class Event < ActiveRecord::Base
|
|||
# - new issue
|
||||
# - merge request
|
||||
def allowed?
|
||||
push? || issue? || merge_request? || membership_changed?
|
||||
push? || issue? || merge_request? || membership_changed? || note? || milestone?
|
||||
end
|
||||
|
||||
def project_name
|
||||
|
@ -94,6 +94,14 @@ class Event < ActiveRecord::Base
|
|||
action == self.class::Reopened
|
||||
end
|
||||
|
||||
def milestone?
|
||||
target_type == "Milestone"
|
||||
end
|
||||
|
||||
def note?
|
||||
target_type == "Note"
|
||||
end
|
||||
|
||||
def issue?
|
||||
target_type == "Issue"
|
||||
end
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
class Milestone < ActiveRecord::Base
|
||||
attr_accessible :title, :description, :due_date, :closed
|
||||
attr_accessor :author_id
|
||||
|
||||
belongs_to :project
|
||||
has_many :issues
|
||||
|
|
|
@ -121,4 +121,12 @@ class Note < ActiveRecord::Base
|
|||
def downvote?
|
||||
note.start_with?('-1') || note.start_with?(':-1:')
|
||||
end
|
||||
|
||||
def noteable_type_name
|
||||
if noteable_type.present?
|
||||
noteable_type.downcase
|
||||
else
|
||||
"wall"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue