From 49946f4f5374050251a6a4a178494f76f6e10ef4 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 5 Oct 2012 23:31:06 +0600 Subject: [PATCH 1/2] [refs #90] fix creating a blocked pull --- app/controllers/projects/pull_requests_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/projects/pull_requests_controller.rb b/app/controllers/projects/pull_requests_controller.rb index 17e4f16ef..478e230f5 100644 --- a/app/controllers/projects/pull_requests_controller.rb +++ b/app/controllers/projects/pull_requests_controller.rb @@ -47,7 +47,7 @@ class Projects::PullRequestsController < Projects::BaseController flash.now[:error] = I18n.t('projects.pull_requests.up_to_date', :to_ref => @pull.to_ref, :from_ref => @pull.from_ref) render :new else - @pull.send(@pull.status) + @pull.send(@pull.status == 'blocked' ? 'block' : @pull.status) redirect_to project_pull_request_path(@pull.to_project, @pull) end else From 3513d47be6c3e05a05cc47efee561c6d82d9f7e8 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Fri, 5 Oct 2012 23:32:29 +0600 Subject: [PATCH 2/2] [refs #90] fix updating pull --- app/models/activity_feed_observer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/activity_feed_observer.rb b/app/models/activity_feed_observer.rb index 25ae5046f..715450e03 100644 --- a/app/models/activity_feed_observer.rb +++ b/app/models/activity_feed_observer.rb @@ -71,7 +71,7 @@ class ActivityFeedObserver < ActiveRecord::Observer when 'GitHook' return unless record.project - record.project.pull_requests.needed_checking.each {|pull| pull.check} + PullRequest.where("from_project_id = ? OR to_project_id = ?", record.project, record.project).needed_checking.each {|pull| pull.check} change_type = record.change_type branch_name = record.refname.split('/').last