summaryrefslogtreecommitdiffstats
path: root/app/models/issue_relation.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-09-21 04:50:07 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-09-21 04:50:07 +0000
commit3268a190ae4a99b6a41bdff7334e986eec3635ec (patch)
tree9b42a0570a7967864ad02c7fb635d0ff74fa195e /app/models/issue_relation.rb
parent5c46cede2b94312b64569f92b05d22ff75603cf6 (diff)
downloadredmine-3268a190ae4a99b6a41bdff7334e986eec3635ec.tar.gz
redmine-3268a190ae4a99b6a41bdff7334e986eec3635ec.zip
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
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 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