diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-12-29 14:26:38 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-12-29 14:27:33 +0000 |
commit | c99d507fccca2e9e4d12e49b4387e007c5481ae9 (patch) | |
tree | 269b10745091c0c0e3941ab756cec0130cbc11bd /activerecord/test/models | |
parent | 0b8b68209ded58e40cc18f3fef2f2c38e3730bb8 (diff) | |
download | rails-c99d507fccca2e9e4d12e49b4387e007c5481ae9.tar.gz rails-c99d507fccca2e9e4d12e49b4387e007c5481ae9.tar.bz2 rails-c99d507fccca2e9e4d12e49b4387e007c5481ae9.zip |
Deprecate implicit eager loading. Closes #950.
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/author.rb | 4 | ||||
-rw-r--r-- | activerecord/test/models/category.rb | 2 | ||||
-rw-r--r-- | activerecord/test/models/person.rb | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb index bfadfd9d75..881e387c8f 100644 --- a/activerecord/test/models/author.rb +++ b/activerecord/test/models/author.rb @@ -3,7 +3,7 @@ class Author < ActiveRecord::Base has_many :very_special_comments, :through => :posts has_many :posts_with_comments, :include => :comments, :class_name => "Post" has_many :popular_grouped_posts, :include => :comments, :class_name => "Post", :group => "type", :having => "SUM(comments_count) > 1", :select => "type" - has_many :posts_with_comments_sorted_by_comment_id, :include => :comments, :class_name => "Post", :order => 'comments.id' + has_many :posts_with_comments_sorted_by_comment_id, :eager_load => :comments, :class_name => "Post", :order => 'comments.id' has_many :posts_sorted_by_id_limited, :class_name => "Post", :order => 'posts.id', :limit => 1 has_many :posts_with_categories, :include => :categories, :class_name => "Post" has_many :posts_with_comments_and_categories, :include => [ :comments, :categories ], :order => "posts.id", :class_name => "Post" @@ -54,7 +54,7 @@ class Author < ActiveRecord::Base has_many :hello_posts, :class_name => "Post", :conditions => "posts.body = 'hello'" has_many :hello_post_comments, :through => :hello_posts, :source => :comments - has_many :posts_with_no_comments, :class_name => 'Post', :conditions => 'comments.id is null', :include => :comments + has_many :posts_with_no_comments, :class_name => 'Post', :conditions => 'comments.id is null', :eager_load => :comments has_many :hello_posts_with_hash_conditions, :class_name => "Post", :conditions => {:body => 'hello'} diff --git a/activerecord/test/models/category.rb b/activerecord/test/models/category.rb index 02b85fd38a..3cd63f0660 100644 --- a/activerecord/test/models/category.rb +++ b/activerecord/test/models/category.rb @@ -2,7 +2,7 @@ class Category < ActiveRecord::Base has_and_belongs_to_many :posts has_and_belongs_to_many :special_posts, :class_name => "Post" has_and_belongs_to_many :other_posts, :class_name => "Post" - has_and_belongs_to_many :posts_with_authors_sorted_by_author_id, :class_name => "Post", :include => :authors, :order => "authors.id" + has_and_belongs_to_many :posts_with_authors_sorted_by_author_id, :class_name => "Post", :eager_load => :authors, :order => "authors.id" has_and_belongs_to_many(:select_testing_posts, :class_name => 'Post', diff --git a/activerecord/test/models/person.rb b/activerecord/test/models/person.rb index 36eb08d02f..5792b4705b 100644 --- a/activerecord/test/models/person.rb +++ b/activerecord/test/models/person.rb @@ -3,13 +3,13 @@ class Person < ActiveRecord::Base has_one :reader has_many :posts, :through => :readers - has_many :posts_with_no_comments, :through => :readers, :source => :post, :include => :comments, :conditions => 'comments.id is null' + has_many :posts_with_no_comments, :through => :readers, :source => :post, :eager_load => :comments, :conditions => 'comments.id is null' has_many :references has_many :bad_references has_many :fixed_bad_references, :conditions => { :favourite => true }, :class_name => 'BadReference' has_one :favourite_reference, :class_name => 'Reference', :conditions => ['favourite=?', true] - has_many :posts_with_comments_sorted_by_comment_id, :through => :readers, :source => :post, :include => :comments, :order => 'comments.id' + has_many :posts_with_comments_sorted_by_comment_id, :through => :readers, :source => :post, :eager_load => :comments, :order => 'comments.id' has_many :jobs, :through => :references has_many :jobs_with_dependent_destroy, :source => :job, :through => :references, :dependent => :destroy |