# File app/models/event.rb, line 36 def determine_action(record) if [Issue, MergeRequest].include? record.class Event::Created elsif record.kind_of? Note Event::Commented end end
# File app/models/event.rb, line 133 def action_name if closed? "closed" elsif merged? "merged" elsif joined? 'joined' elsif left? 'left' else "opened" end end
Next events currently enabled for system
- push - new issue - merge request
# File app/models/event.rb, line 49 def allowed? push? || issue? || merge_request? || membership_changed? end
# File app/models/event.rb, line 104 def changed_issue? target_type == "Issue" && [Closed, Reopened].include?(action) end
# File app/models/event.rb, line 99 def changed_merge_request? target_type == "MergeRequest" && [Closed, Reopened].include?(action) end
# File app/models/event.rb, line 73 def closed? action == self.class::Closed end
# File app/models/event.rb, line 121 def issue target if target_type == "Issue" end
# File app/models/event.rb, line 81 def issue? target_type == "Issue" end
# File app/models/event.rb, line 109 def joined? action == Joined end
# File app/models/event.rb, line 113 def left? action == Left end
# File app/models/event.rb, line 117 def membership_changed? joined? || left? end
# File app/models/event.rb, line 125 def merge_request target if target_type == "MergeRequest" end
# File app/models/event.rb, line 85 def merge_request? target_type == "MergeRequest" end
# File app/models/event.rb, line 69 def merged? action == self.class::Merged end
# File app/models/event.rb, line 89 def new_issue? target_type == "Issue" && action == Created end
# File app/models/event.rb, line 94 def new_merge_request? target_type == "MergeRequest" && action == Created end
# File app/models/event.rb, line 53 def project_name if project project.name else "(deleted project)" end end
# File app/models/event.rb, line 65 def push? action == self.class::Pushed && valid_push? end
# File app/models/event.rb, line 77 def reopened? action == self.class::Reopened end
# File app/models/event.rb, line 61 def target_title target.try :title end