You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/cases/pessimistic_locking_test_sqlserver.rb
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -16,25 +16,25 @@ class PessimisticLockingTestSqlserver < ActiveRecord::TestCase
16
16
should'lock with simple find'do
17
17
assert_nothing_raiseddo
18
18
Person.transactiondo
19
-
Person.find1,:lock=>true
19
+
Person.lock(true).find(1)
20
20
end
21
21
end
22
22
end
23
-
23
+
#DEPRECATION WARNING: ActiveRecord::Base#with_scope and #with_exclusive_scope are deprecated. Please use ActiveRecord::Relation#scoping instead. (You can use #merge to merge multiple scopes together.). (called from with_scope at /Users/acarey/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-deprecated_finders-1.0.3/lib/active_record/deprecated_finders/base.rb:75)
24
24
should'lock with scoped find'do
25
25
assert_nothing_raiseddo
26
26
Person.transactiondo
27
-
Person.send(:with_scope,:find=>{:lock=>true})do
28
-
Person.find1
27
+
Person.lock(true).scopingdo
28
+
Person.find(1)
29
29
end
30
30
end
31
31
end
32
32
end
33
33
34
34
should'lock with eager find'do
35
-
assert_nothing_raiseddo
35
+
assert_nothing_raiseddo
36
36
Person.transactiondo
37
-
Person.find1,:include=>:readers,:lock=>true
37
+
Person.lock(true).includes(:readers).find(1)
38
38
end
39
39
end
40
40
end
@@ -52,7 +52,7 @@ class PessimisticLockingTestSqlserver < ActiveRecord::TestCase
52
52
53
53
should'simply add lock to find all'do
54
54
assert_sql%r|SELECT \[people\]\.\* FROM \[people\] WITH \(NOLOCK\)|do
55
-
Person.all(:lock=>'WITH (NOLOCK)')
55
+
Person.lock('WITH (NOLOCK)').load
56
56
end
57
57
end
58
58
@@ -68,7 +68,7 @@ class PessimisticLockingTestSqlserver < ActiveRecord::TestCase
68
68
eager_ids_sql=/SELECT TOP \(5\).*FROM \[people\] WITH \(NOLOCK\)/
69
69
loader_sql=/FROM \[people\] WITH \(NOLOCK\).*WHERE \[people\]\.\[id\] IN/
0 commit comments