Rails4: replace deprecated Relation#update_all at IssueTest
git-svn-id: http://svn.redmine.org/redmine/trunk@12547 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
d12c8e8397
commit
92a948855e
|
@ -2027,7 +2027,7 @@ class IssueTest < ActiveSupport::TestCase
|
||||||
r = IssueRelation.create!(:issue_from => Issue.find(3),
|
r = IssueRelation.create!(:issue_from => Issue.find(3),
|
||||||
:issue_to => Issue.find(7),
|
:issue_to => Issue.find(7),
|
||||||
:relation_type => IssueRelation::TYPE_PRECEDES)
|
:relation_type => IssueRelation::TYPE_PRECEDES)
|
||||||
IssueRelation.update_all("issue_to_id = 1", ["id = ?", r.id])
|
IssueRelation.where(["id = ?", r.id]).update_all("issue_to_id = 1")
|
||||||
|
|
||||||
assert_equal [2, 3], Issue.find(1).all_dependent_issues.collect(&:id).sort
|
assert_equal [2, 3], Issue.find(1).all_dependent_issues.collect(&:id).sort
|
||||||
end
|
end
|
||||||
|
@ -2047,12 +2047,12 @@ class IssueTest < ActiveSupport::TestCase
|
||||||
r = IssueRelation.create!(:issue_from => Issue.find(8),
|
r = IssueRelation.create!(:issue_from => Issue.find(8),
|
||||||
:issue_to => Issue.find(7),
|
:issue_to => Issue.find(7),
|
||||||
:relation_type => IssueRelation::TYPE_RELATES)
|
:relation_type => IssueRelation::TYPE_RELATES)
|
||||||
IssueRelation.update_all("issue_to_id = 2", ["id = ?", r.id])
|
IssueRelation.where(["id = ?", r.id]).update_all("issue_to_id = 2")
|
||||||
|
|
||||||
r = IssueRelation.create!(:issue_from => Issue.find(3),
|
r = IssueRelation.create!(:issue_from => Issue.find(3),
|
||||||
:issue_to => Issue.find(7),
|
:issue_to => Issue.find(7),
|
||||||
:relation_type => IssueRelation::TYPE_RELATES)
|
:relation_type => IssueRelation::TYPE_RELATES)
|
||||||
IssueRelation.update_all("issue_to_id = 1", ["id = ?", r.id])
|
IssueRelation.where(["id = ?", r.id]).update_all("issue_to_id = 1")
|
||||||
|
|
||||||
assert_equal [2, 3, 8], Issue.find(1).all_dependent_issues.collect(&:id).sort
|
assert_equal [2, 3, 8], Issue.find(1).all_dependent_issues.collect(&:id).sort
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue