Skip to content

Commit

Permalink
removed pusher
Browse files Browse the repository at this point in the history
  • Loading branch information
Topher committed Aug 15, 2010
1 parent 4d427fe commit 4f4f3f2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/controllers/repositories_controller.rb
Expand Up @@ -47,7 +47,7 @@ def create
# @repository = Repository.new(params[:repository])
push = JSON.parse(params[:payload])

@repository = Repository.find_by_url(push["pusher"]['repository']['url'])
@repository = Repository.find_by_url(push['repository']['url'])


if @repository
Expand All @@ -56,15 +56,15 @@ def create
@repository.new
end

@repository.name = push["pusher"]['repository']['name']
@repository.description = push["pusher"]['repository']['description']
@repository.url = push["pusher"]['repository']['url']
@repository.watchers = push["pusher"]['repository']['watchers']
@repository.forks = push["pusher"]['repository']['forks']
@repository.privateflag = push["pusher"]['repository']['private']
@repository.homepage = push["pusher"]['repository']['homepage']
@repository.ownername = push["pusher"]['repository']['owner']['name']
@repository.owneremail = push["pusher"]['repository']['owner']['email']
@repository.name = push['repository']['name']
@repository.description = push['repository']['description']
@repository.url = push['repository']['url']
@repository.watchers = push['repository']['watchers']
@repository.forks = push['repository']['forks']
@repository.privateflag = push['repository']['private']
@repository.homepage = push['repository']['homepage']
@repository.ownername = push['repository']['owner']['name']
@repository.owneremail = push['repository']['owner']['email']

respond_to do |format|
if @repository.save
Expand Down
15 changes: 15 additions & 0 deletions log/development.log
Expand Up @@ -186,3 +186,18 @@ ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticit
Rendered rescues/_trace (102.8ms)
Rendered rescues/_request_and_response (1.4ms)
Rendering rescues/layout (unprocessable_entity)
SQL (0.1ms) SET NAMES 'utf8'
SQL (0.1ms) SET SQL_AUTO_IS_NULL=0


Processing RepositoriesController#create (for 127.0.0.1 at 2010-08-15 09:46:48) [POST]
Parameters: {"payload"=>"{\"pusher\":{\"email\":\"chris@matthieu.us\",\"name\":\"chrismatthieu\"},\"after\":\"4d427fee5ee048041823000c55a195e4925fe534\",\"commits\":[{\"message\":\"removed forgery\",\"url\":\"http://github.com/chrismatthieu/ahnhub/commit/4d427fee5ee048041823000c55a195e4925fe534\",\"removed\":[],\"modified\":[\"app/controllers/application_controller.rb\",\"log/development.log\"],\"timestamp\":\"2010-08-15T09:46:40-07:00\",\"added\":[],\"id\":\"4d427fee5ee048041823000c55a195e4925fe534\",\"author\":{\"email\":\"topher@topher.local\",\"name\":\"Topher\"}}],\"repository\":{\"has_downloads\":true,\"description\":\"Adhearsion component library\",\"pushed_at\":\"2010/08/15 09:46:47 -0700\",\"url\":\"http://github.com/chrismatthieu/ahnhub\",\"has_wiki\":true,\"fork\":false,\"forks\":0,\"open_issues\":0,\"private\":false,\"watchers\":1,\"has_issues\":true,\"owner\":{\"email\":\"chris@matthieu.us\",\"name\":\"chrismatthieu\"},\"name\":\"ahnhub\",\"created_at\":\"2010/08/14 11:54:20 -0700\",\"homepage\":\"http://ahnhub.com\"},\"forced\":false,\"ref\":\"refs/heads/master\",\"compare\":\"http://github.com/chrismatthieu/ahnhub/compare/51d9413...4d427fe\",\"before\":\"51d9413a32e83217302082f35e3e9fe2bb0e3890\"}"}

NoMethodError (You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]):
app/controllers/repositories_controller.rb:50:in `create'

Rendered rescues/_trace (40.2ms)
Rendered rescues/_request_and_response (0.6ms)
Rendering rescues/layout (internal_server_error)

0 comments on commit 4f4f3f2

Please sign in to comment.