From 4cc2afdf2eb414cb4aeea5ffab1ac86f56e97a55 Mon Sep 17 00:00:00 2001
From: skv <skv-headless@yandex.ru>
Date: Sun, 6 Apr 2014 19:42:24 +0400
Subject: [PATCH] Fix url generation error on hook invalid create

---
 app/controllers/projects/hooks_controller.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb
index a863b31832..c43d26385f 100644
--- a/app/controllers/projects/hooks_controller.rb
+++ b/app/controllers/projects/hooks_controller.rb
@@ -18,7 +18,7 @@ class Projects::HooksController < Projects::ApplicationController
     if @hook.valid?
       redirect_to project_hooks_path(@project)
     else
-      @hooks = @project.hooks
+      @hooks = @project.hooks.select(&:persisted?)
       render :index
     end
   end
-- 
2.30.9