Commit 911ce0d3e5c97ac5de9badf04623d6ae6436399a
1 parent
82c8c42a
Exists in
master
and in
4 other branches
reverted event data
Showing
1 changed file
with
7 additions
and
7 deletions
Show diff stats
app/models/event/push_trait.rb
1 | module Event::PushTrait | 1 | module Event::PushTrait |
2 | as_trait do | 2 | as_trait do |
3 | def valid_push? | 3 | def valid_push? |
4 | - data["ref"] | 4 | + data[:ref] |
5 | rescue => ex | 5 | rescue => ex |
6 | false | 6 | false |
7 | end | 7 | end |
8 | 8 | ||
9 | def tag? | 9 | def tag? |
10 | - data["ref"]["refs/tags"] | 10 | + data[:ref]["refs/tags"] |
11 | end | 11 | end |
12 | 12 | ||
13 | def new_branch? | 13 | def new_branch? |
@@ -27,11 +27,11 @@ module Event::PushTrait | @@ -27,11 +27,11 @@ module Event::PushTrait | ||
27 | end | 27 | end |
28 | 28 | ||
29 | def commit_from | 29 | def commit_from |
30 | - data["before"] | 30 | + data[:before] |
31 | end | 31 | end |
32 | 32 | ||
33 | def commit_to | 33 | def commit_to |
34 | - data["after"] | 34 | + data[:after] |
35 | end | 35 | end |
36 | 36 | ||
37 | def ref_name | 37 | def ref_name |
@@ -43,15 +43,15 @@ module Event::PushTrait | @@ -43,15 +43,15 @@ module Event::PushTrait | ||
43 | end | 43 | end |
44 | 44 | ||
45 | def branch_name | 45 | def branch_name |
46 | - @branch_name ||= data["ref"].gsub("refs/heads/", "") | 46 | + @branch_name ||= data[:ref].gsub("refs/heads/", "") |
47 | end | 47 | end |
48 | 48 | ||
49 | def tag_name | 49 | def tag_name |
50 | - @tag_name ||= data["ref"].gsub("refs/tags/", "") | 50 | + @tag_name ||= data[:ref].gsub("refs/tags/", "") |
51 | end | 51 | end |
52 | 52 | ||
53 | def commits | 53 | def commits |
54 | - @commits ||= data["commits"].map do |commit| | 54 | + @commits ||= data[:commits].map do |commit| |
55 | project.commit(commit["id"]) | 55 | project.commit(commit["id"]) |
56 | end | 56 | end |
57 | end | 57 | end |