Polishin & fixed tree switch

This commit is contained in:
Dmitriy Zaporozhets 2012-03-06 00:29:40 +02:00
parent cb59aade4e
commit eb7bbedb20
11 changed files with 82 additions and 50 deletions

View file

@ -33,6 +33,10 @@ class Event < ActiveRecord::Base
action == self.class::Pushed
end
def new_tag?
data[:ref]["refs/tags"]
end
def new_branch?
data[:before] =~ /^00000/
end
@ -49,6 +53,10 @@ class Event < ActiveRecord::Base
@branch_name ||= data[:ref].gsub("refs/heads/", "")
end
def tag_name
@tag_name ||= data[:ref].gsub("refs/tags/", "")
end
def pusher
User.find_by_id(data[:user_id])
end