aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
authorFrederick Cheung <frederick.cheung@gmail.com>2008-12-19 01:02:21 +0000
committerFrederick Cheung <frederick.cheung@gmail.com>2008-12-26 18:25:55 +0000
commit5cebe69e74d411c3c9e5f6ab9d4b2b16ee36177c (patch)
tree7e30226bcda0e5f9292b71927a32d5c15133e391 /activerecord/test/schema
parenteb457ceee13779ade67e1bdebd2919d476148277 (diff)
downloadrails-5cebe69e74d411c3c9e5f6ab9d4b2b16ee36177c.tar.gz
rails-5cebe69e74d411c3c9e5f6ab9d4b2b16ee36177c.tar.bz2
rails-5cebe69e74d411c3c9e5f6ab9d4b2b16ee36177c.zip
Preload uses exclusive scope [#643 state:resolved]
With self referential associations, the scope for the the top level should not affect fetching of associations, for example when doing Person.male.find :all, :include => :friends we should load all of the friends for each male, not just the male friends.
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r--activerecord/test/schema/schema.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb
index fbacc692b4..8199cb8fc7 100644
--- a/activerecord/test/schema/schema.rb
+++ b/activerecord/test/schema/schema.rb
@@ -298,8 +298,10 @@ ActiveRecord::Schema.define do
end
create_table :people, :force => true do |t|
- t.string :first_name, :null => false
- t.integer :lock_version, :null => false, :default => 0
+ t.string :first_name, :null => false
+ t.references :primary_contact
+ t.string :gender, :limit => 1
+ t.integer :lock_version, :null => false, :default => 0
end
create_table :pets, :primary_key => :pet_id ,:force => true do |t|