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
This commit is contained in:
parent
5c46cede2b
commit
3268a190ae
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue