From 3268a190ae4a99b6a41bdff7334e986eec3635ec Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Wed, 21 Sep 2011 04:50:07 +0000 Subject: [PATCH] Rails3: model: replace deprecated 'before_save' method at IssueRelation model git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7426 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue_relation.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/issue_relation.rb b/app/models/issue_relation.rb index cc67b059e..d359b1ddf 100644 --- a/app/models/issue_relation.rb +++ b/app/models/issue_relation.rb @@ -45,6 +45,8 @@ class IssueRelation < ActiveRecord::Base attr_protected :issue_from_id, :issue_to_id + before_save :handle_issue_order + def visible?(user=User.current) (issue_from.nil? || issue_from.visible?(user)) && (issue_to.nil? || issue_to.visible?(user)) end @@ -96,7 +98,7 @@ class IssueRelation < ActiveRecord::Base TYPES[relation_type] ? TYPES[relation_type][(self.issue_from_id == issue.id) ? :name : :sym_name] : :unknow end - def before_save + def handle_issue_order reverse_if_needed if TYPE_PRECEDES == relation_type -- 2.39.5