[refs #90] remove commits from pull refs

This commit is contained in:
Alexander Machehin 2012-08-08 00:23:17 +06:00
parent edf882f2a1
commit 0ddb960b8b
1 changed files with 1 additions and 2 deletions

View File

@ -144,8 +144,7 @@ class PullRequest < ActiveRecord::Base
def self.check_ref(record, attr, value)
project = attr == :head_ref ? record.head_project : record.base_project
if !((project.repo.branches_and_tags).map(&:name).include?(value) || project.repo.commits.map(&:id).include?(value))
record.errors.add attr, I18n.t('projects.pull_requests.wrong_ref')
record.errors.add attr, I18n.t('projects.pull_requests.wrong_ref') unless project.repo.branches_and_tags.map(&:name).include?(value)
end
end