summaryrefslogtreecommitdiffstats
path: root/app/models/issue_relation.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-09-01 00:43:42 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-09-01 00:43:42 +0000
commit86d6f2fe372ee2725a6993e618d83f42d593f1e9 (patch)
treeecf3cb43b01018e35ba7c9990abee1b4ce2426d1 /app/models/issue_relation.rb
parent52dd8b56c9d908e036e34930ac0aef32010a399e (diff)
downloadredmine-86d6f2fe372ee2725a6993e618d83f42d593f1e9.tar.gz
redmine-86d6f2fe372ee2725a6993e618d83f42d593f1e9.zip
Rails3: replace deprecated 'validate' method at IssueRelation model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6937 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_relation.rb')
-rw-r--r--app/models/issue_relation.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/issue_relation.rb b/app/models/issue_relation.rb
index b4cb220bc..cc67b059e 100644
--- a/app/models/issue_relation.rb
+++ b/app/models/issue_relation.rb
@@ -41,6 +41,8 @@ class IssueRelation < ActiveRecord::Base
validates_numericality_of :delay, :allow_nil => true
validates_uniqueness_of :issue_to_id, :scope => :issue_from_id
+ validate :validate_issue_relation
+
attr_protected :issue_from_id, :issue_to_id
def visible?(user=User.current)
@@ -61,7 +63,7 @@ class IssueRelation < ActiveRecord::Base
end
end
- def validate
+ def validate_issue_relation
if issue_from && issue_to
errors.add :issue_to_id, :invalid if issue_from_id == issue_to_id
errors.add :issue_to_id, :not_same_project unless issue_from.project_id == issue_to.project_id || Setting.cross_project_issue_relations?