Fix validation method for Gitlab::GithubImport::PullRequestFormatter

This commit is contained in:
Douglas Barbosa Alexandre
2016-05-13 17:55:43 -05:00
parent 795a7ca8f1
commit ebaa19c162
4 changed files with 22 additions and 5 deletions
@@ -15,6 +15,10 @@ module Gitlab
repo.present?
end
def valid?
repo.present?
end
private
def short_id
@@ -29,7 +29,7 @@ module Gitlab
end
def valid?
!cross_project?
source_branch.valid? && target_branch.valid? && !cross_project?
end
def source_branch
@@ -65,8 +65,7 @@ module Gitlab
end
def cross_project?
source_branch_repo.present? && target_branch_repo.present? &&
source_branch_repo.id != target_branch_repo.id
source_branch_repo.id != target_branch_repo.id
end
def description