mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
stop calling deprecated apis
This commit is contained in:
parent
9f5c18ce07
commit
7e91ad3f89
2 changed files with 5 additions and 5 deletions
|
@ -14,7 +14,7 @@ class MethodScopingTest < ActiveRecord::TestCase
|
||||||
|
|
||||||
def test_set_conditions
|
def test_set_conditions
|
||||||
Developer.send(:with_scope, :find => { :conditions => 'just a test...' }) do
|
Developer.send(:with_scope, :find => { :conditions => 'just a test...' }) do
|
||||||
assert_equal '(just a test...)', Developer.scoped.arel.send(:where_clauses).join(' AND ')
|
assert_match '(just a test...)', Developer.scoped.arel.to_sql
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ class NestedScopingTest < ActiveRecord::TestCase
|
||||||
Developer.send(:with_scope, :find => { :conditions => 'salary = 80000' }) do
|
Developer.send(:with_scope, :find => { :conditions => 'salary = 80000' }) do
|
||||||
Developer.send(:with_scope, :find => { :limit => 10 }) do
|
Developer.send(:with_scope, :find => { :limit => 10 }) do
|
||||||
devs = Developer.scoped
|
devs = Developer.scoped
|
||||||
assert_equal '(salary = 80000)', devs.arel.send(:where_clauses).join(' AND ')
|
assert_match '(salary = 80000)', devs.arel.to_sql
|
||||||
assert_equal 10, devs.taken
|
assert_equal 10, devs.taken
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -309,7 +309,7 @@ class NestedScopingTest < ActiveRecord::TestCase
|
||||||
Developer.send(:with_scope, :find => { :conditions => "name = 'David'" }) do
|
Developer.send(:with_scope, :find => { :conditions => "name = 'David'" }) do
|
||||||
Developer.send(:with_scope, :find => { :conditions => 'salary = 80000' }) do
|
Developer.send(:with_scope, :find => { :conditions => 'salary = 80000' }) do
|
||||||
devs = Developer.scoped
|
devs = Developer.scoped
|
||||||
assert_equal "(name = 'David') AND (salary = 80000)", devs.arel.send(:where_clauses).join(' AND ')
|
assert_match "(name = 'David') AND (salary = 80000)", devs.arel.to_sql
|
||||||
assert_equal(1, Developer.count)
|
assert_equal(1, Developer.count)
|
||||||
end
|
end
|
||||||
Developer.send(:with_scope, :find => { :conditions => "name = 'Maiha'" }) do
|
Developer.send(:with_scope, :find => { :conditions => "name = 'Maiha'" }) do
|
||||||
|
@ -322,7 +322,7 @@ class NestedScopingTest < ActiveRecord::TestCase
|
||||||
Developer.send(:with_scope, :find => { :conditions => 'salary = 80000', :limit => 10 }) do
|
Developer.send(:with_scope, :find => { :conditions => 'salary = 80000', :limit => 10 }) do
|
||||||
Developer.send(:with_scope, :find => { :conditions => "name = 'David'" }) do
|
Developer.send(:with_scope, :find => { :conditions => "name = 'David'" }) do
|
||||||
devs = Developer.scoped
|
devs = Developer.scoped
|
||||||
assert_equal "(salary = 80000) AND (name = 'David')", devs.arel.send(:where_clauses).join(' AND ')
|
assert_match "(salary = 80000) AND (name = 'David')", devs.arel.to_sql
|
||||||
assert_equal 10, devs.taken
|
assert_equal 10, devs.taken
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -152,7 +152,7 @@ class NestedRelationScopingTest < ActiveRecord::TestCase
|
||||||
Developer.where('salary = 80000').scoping do
|
Developer.where('salary = 80000').scoping do
|
||||||
Developer.limit(10).scoping do
|
Developer.limit(10).scoping do
|
||||||
devs = Developer.scoped
|
devs = Developer.scoped
|
||||||
assert_equal '(salary = 80000)', devs.arel.send(:where_clauses).join(' AND ')
|
assert_match '(salary = 80000)', devs.arel.to_sql
|
||||||
assert_equal 10, devs.taken
|
assert_equal 10, devs.taken
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue