diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-03 17:50:11 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-03 17:50:11 +0000 |
commit | f8783abf0cd409d53e7e104b576d45966252378b (patch) | |
tree | 2f8a0e604a7639e0b7983631208a7e7360928be0 /activerecord/test/fixtures | |
parent | 46f2b03eacf5dd39c9283697d7d05f0ccb5f4a72 (diff) | |
download | rails-f8783abf0cd409d53e7e104b576d45966252378b.tar.gz rails-f8783abf0cd409d53e7e104b576d45966252378b.tar.bz2 rails-f8783abf0cd409d53e7e104b576d45966252378b.zip |
Made eager loading work even more
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1083 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/author.rb | 2 | ||||
-rw-r--r-- | activerecord/test/fixtures/authors.yml | 2 | ||||
-rw-r--r-- | activerecord/test/fixtures/db_definitions/sqlite.sql | 2 | ||||
-rw-r--r-- | activerecord/test/fixtures/post.rb | 4 | ||||
-rw-r--r-- | activerecord/test/fixtures/posts.yml | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/test/fixtures/author.rb b/activerecord/test/fixtures/author.rb index 8d12190086..e159d38597 100644 --- a/activerecord/test/fixtures/author.rb +++ b/activerecord/test/fixtures/author.rb @@ -1,3 +1,3 @@ class Author < ActiveRecord::Base - belongs_to :post + has_many :posts end
\ No newline at end of file diff --git a/activerecord/test/fixtures/authors.yml b/activerecord/test/fixtures/authors.yml index 718c317c37..f59b84fa45 100644 --- a/activerecord/test/fixtures/authors.yml +++ b/activerecord/test/fixtures/authors.yml @@ -1,9 +1,7 @@ david: id: 1 - post_id: 1 name: David mary: id: 2 - post_id: 2 name: Mary diff --git a/activerecord/test/fixtures/db_definitions/sqlite.sql b/activerecord/test/fixtures/db_definitions/sqlite.sql index a6f2efcbfe..db31835807 100644 --- a/activerecord/test/fixtures/db_definitions/sqlite.sql +++ b/activerecord/test/fixtures/db_definitions/sqlite.sql @@ -118,6 +118,7 @@ CREATE TABLE 'computers' ( CREATE TABLE 'posts' ( 'id' INTEGER NOT NULL PRIMARY KEY, + 'author_id' INTEGER NOT NULL, 'title' VARCHAR(255) NOT NULL, 'body' TEXT NOT NULL ); @@ -130,7 +131,6 @@ CREATE TABLE 'comments' ( CREATE TABLE 'authors' ( 'id' INTEGER NOT NULL PRIMARY KEY, - 'post_id' INTEGER NOT NULL, 'name' VARCHAR(255) NOT NULL ); diff --git a/activerecord/test/fixtures/post.rb b/activerecord/test/fixtures/post.rb index 1fd78b8343..a09e192c04 100644 --- a/activerecord/test/fixtures/post.rb +++ b/activerecord/test/fixtures/post.rb @@ -1,4 +1,4 @@ class Post < ActiveRecord::Base - has_many :comments - has_one :author + belongs_to :author + has_many :comments end
\ No newline at end of file diff --git a/activerecord/test/fixtures/posts.yml b/activerecord/test/fixtures/posts.yml index 21a110ef91..7c706b6818 100644 --- a/activerecord/test/fixtures/posts.yml +++ b/activerecord/test/fixtures/posts.yml @@ -1,9 +1,11 @@ welcome: id: 1 + author_id: 1 title: Welcome to the weblog body: Such a lovely day thinking: id: 2 + author_id: 1 title: So I was thinking body: Like I hopefully always am |