Commit 911ce0d3e5c97ac5de9badf04623d6ae6436399a

Authored by randx
1 parent 82c8c42a

reverted event data

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