Describe for Roles
This commit is contained in:
parent
64db5f808b
commit
82ae973a99
11 changed files with 75 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
# == PushEvent role
|
||||
#
|
||||
# Extends Event model functionality by providing extra methods related to push events
|
||||
#
|
||||
# Used by Event
|
||||
#
|
||||
module PushEvent
|
||||
def valid_push?
|
||||
data[:ref]
|
||||
|
@ -58,7 +64,7 @@ module PushEvent
|
|||
@commits ||= data[:commits].map { |commit| project.commit(commit[:id]) }.reverse
|
||||
end
|
||||
|
||||
def commits_count
|
||||
def commits_count
|
||||
data[:total_commits_count] || commits.count || 0
|
||||
end
|
||||
|
||||
|
@ -88,7 +94,7 @@ module PushEvent
|
|||
nil
|
||||
end
|
||||
|
||||
def push_with_commits?
|
||||
def push_with_commits?
|
||||
md_ref? && commits.any? && parent_commit && last_commit
|
||||
rescue Grit::NoSuchPathError
|
||||
false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue