summaryrefslogtreecommitdiffstats
path: root/app/models/changeset.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-02 18:09:37 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-02 18:09:37 +0000
commitd02f6a8e32d1e09e5303d36f09788a2d19ac413a (patch)
treea097d50913117025ded4f0d3a32a304470d1be00 /app/models/changeset.rb
parent3dc73dcb88473139bdf9f2a3b95c5b2f9df8875f (diff)
downloadredmine-d02f6a8e32d1e09e5303d36f09788a2d19ac413a.tar.gz
redmine-d02f6a8e32d1e09e5303d36f09788a2d19ac413a.zip
Adds a setting that allows to reference/fix issues of all projects (#3087).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8750 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/changeset.rb')
-rw-r--r--app/models/changeset.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index e90901ef5..d017ad03b 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -187,11 +187,13 @@ class Changeset < ActiveRecord::Base
private
# Finds an issue that can be referenced by the commit message
- # i.e. an issue that belong to the repository project, a subproject or a parent project
def find_referenced_issue_by_id(id)
return nil if id.blank?
issue = Issue.find_by_id(id.to_i, :include => :project)
- if issue
+ if Setting.commit_cross_project_ref?
+ # all issues can be referenced/fixed
+ elsif issue
+ # issue that belong to the repository project, a subproject or a parent project only
unless issue.project &&
(project == issue.project || project.is_ancestor_of?(issue.project) ||
project.is_descendant_of?(issue.project))