aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/join_model_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-04-27 12:37:21 +0100
committerJon Leighton <j@jonathanleighton.com>2012-04-27 12:37:21 +0100
commit0ed05b0e7379e0a6aa47c5677b90383b9f0132b2 (patch)
treeb5b67fb711af82657ef42509724f490236cdb516 /activerecord/test/cases/associations/join_model_test.rb
parent61555a0df11f535d46a0a631fbb0d0773613d08e (diff)
downloadrails-0ed05b0e7379e0a6aa47c5677b90383b9f0132b2.tar.gz
rails-0ed05b0e7379e0a6aa47c5677b90383b9f0132b2.tar.bz2
rails-0ed05b0e7379e0a6aa47c5677b90383b9f0132b2.zip
find and replace deprecated keys
Diffstat (limited to 'activerecord/test/cases/associations/join_model_test.rb')
-rw-r--r--activerecord/test/cases/associations/join_model_test.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb
index 63b7acfc7a..5d25cc20f7 100644
--- a/activerecord/test/cases/associations/join_model_test.rb
+++ b/activerecord/test/cases/associations/join_model_test.rb
@@ -238,7 +238,7 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
def test_include_has_many_through
posts = Post.scoped(:order => 'posts.id').all
- posts_with_authors = Post.scoped(:include => :authors, :order => 'posts.id').all
+ posts_with_authors = Post.scoped(:includes => :authors, :order => 'posts.id').all
assert_equal posts.length, posts_with_authors.length
posts.length.times do |i|
assert_equal posts[i].authors.length, assert_no_queries { posts_with_authors[i].authors.length }
@@ -263,7 +263,7 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
def test_include_polymorphic_has_many_through
posts = Post.scoped(:order => 'posts.id').all
- posts_with_tags = Post.scoped(:include => :tags, :order => 'posts.id').all
+ posts_with_tags = Post.scoped(:includes => :tags, :order => 'posts.id').all
assert_equal posts.length, posts_with_tags.length
posts.length.times do |i|
assert_equal posts[i].tags.length, assert_no_queries { posts_with_tags[i].tags.length }
@@ -272,7 +272,7 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
def test_include_polymorphic_has_many
posts = Post.scoped(:order => 'posts.id').all
- posts_with_taggings = Post.scoped(:include => :taggings, :order => 'posts.id').all
+ posts_with_taggings = Post.scoped(:includes => :taggings, :order => 'posts.id').all
assert_equal posts.length, posts_with_taggings.length
posts.length.times do |i|
assert_equal posts[i].taggings.length, assert_no_queries { posts_with_taggings[i].taggings.length }
@@ -292,8 +292,8 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
end
def test_has_many_find_conditions
- assert_equal categories(:general), authors(:david).categories.scoped(:conditions => "categories.name = 'General'").first
- assert_nil authors(:david).categories.scoped(:conditions => "categories.name = 'Technology'").first
+ assert_equal categories(:general), authors(:david).categories.scoped(:where => "categories.name = 'General'").first
+ assert_nil authors(:david).categories.scoped(:where => "categories.name = 'Technology'").first
end
def test_has_many_class_methods_called_by_method_missing
@@ -386,7 +386,7 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
end
def test_has_many_through_has_many_find_conditions
- options = { :conditions => "comments.#{QUOTED_TYPE}='SpecialComment'", :order => 'comments.id' }
+ options = { :where => "comments.#{QUOTED_TYPE}='SpecialComment'", :order => 'comments.id' }
assert_equal comments(:does_it_hurt), authors(:david).comments.scoped(options).first
end
@@ -411,7 +411,7 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
end
def test_eager_load_has_many_through_has_many
- author = Author.scoped(:conditions => ['name = ?', 'David'], :include => :comments, :order => 'comments.id').first
+ author = Author.scoped(:where => ['name = ?', 'David'], :includes => :comments, :order => 'comments.id').first
SpecialComment.new; VerySpecialComment.new
assert_no_queries do
assert_equal [1,2,3,5,6,7,8,9,10,12], author.comments.collect(&:id)
@@ -419,7 +419,7 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
end
def test_eager_load_has_many_through_has_many_with_conditions
- post = Post.scoped(:include => :invalid_tags).first
+ post = Post.scoped(:includes => :invalid_tags).first
assert_no_queries do
post.invalid_tags
end
@@ -427,8 +427,8 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
def test_eager_belongs_to_and_has_one_not_singularized
assert_nothing_raised do
- Author.scoped(:include => :author_address).first
- AuthorAddress.scoped(:include => :author).first
+ Author.scoped(:includes => :author_address).first
+ AuthorAddress.scoped(:includes => :author).first
end
end
@@ -633,7 +633,7 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
def test_preload_polymorphic_has_many_through
posts = Post.scoped(:order => 'posts.id').all
- posts_with_tags = Post.scoped(:include => :tags, :order => 'posts.id').all
+ posts_with_tags = Post.scoped(:includes => :tags, :order => 'posts.id').all
assert_equal posts.length, posts_with_tags.length
posts.length.times do |i|
assert_equal posts[i].tags.length, assert_no_queries { posts_with_tags[i].tags.length }
@@ -641,7 +641,7 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
end
def test_preload_polymorph_many_types
- taggings = Tagging.scoped(:include => :taggable, :conditions => ['taggable_type != ?', 'FakeModel']).all
+ taggings = Tagging.scoped(:includes => :taggable, :where => ['taggable_type != ?', 'FakeModel']).all
assert_no_queries do
taggings.first.taggable.id
taggings[1].taggable.id
@@ -654,13 +654,13 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
def test_preload_nil_polymorphic_belongs_to
assert_nothing_raised do
- Tagging.scoped(:include => :taggable, :conditions => ['taggable_type IS NULL']).all
+ Tagging.scoped(:includes => :taggable, :where => ['taggable_type IS NULL']).all
end
end
def test_preload_polymorphic_has_many
posts = Post.scoped(:order => 'posts.id').all
- posts_with_taggings = Post.scoped(:include => :taggings, :order => 'posts.id').all
+ posts_with_taggings = Post.scoped(:includes => :taggings, :order => 'posts.id').all
assert_equal posts.length, posts_with_taggings.length
posts.length.times do |i|
assert_equal posts[i].taggings.length, assert_no_queries { posts_with_taggings[i].taggings.length }
@@ -668,7 +668,7 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
end
def test_belongs_to_shared_parent
- comments = Comment.scoped(:include => :post, :conditions => 'post_id = 1').all
+ comments = Comment.scoped(:includes => :post, :where => 'post_id = 1').all
assert_no_queries do
assert_equal comments.first.post, comments[1].post
end