]> source.dussan.org Git - redmine.git/commitdiff
Rails3: model: replace deprecated 'before_save' method at IssueRelation model
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 21 Sep 2011 04:50:07 +0000 (04:50 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 21 Sep 2011 04:50:07 +0000 (04:50 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7426 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue_relation.rb

index cc67b059ed42e2008c69ef8d6269d9d12c1e6de9..d359b1ddf3b5e25eeb87242f1be8b901c96d6c14 100644 (file)
@@ -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