From cf3e9664a41b8137556b53efc1b1dbaeae68c079 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 27 Oct 2007 19:25:23 +0000 Subject: [PATCH] Missed svn adds for [8042]. References #6466. git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-stable@8044 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/fixtures/book.rb | 4 ++++ activerecord/test/fixtures/books.yml | 7 +++++++ activerecord/test/fixtures/citation.rb | 6 ++++++ 3 files changed, 17 insertions(+) create mode 100644 activerecord/test/fixtures/book.rb create mode 100644 activerecord/test/fixtures/books.yml create mode 100644 activerecord/test/fixtures/citation.rb diff --git a/activerecord/test/fixtures/book.rb b/activerecord/test/fixtures/book.rb new file mode 100644 index 0000000000000..cfd07abddc83a --- /dev/null +++ b/activerecord/test/fixtures/book.rb @@ -0,0 +1,4 @@ +class Book < ActiveRecord::Base + has_many :citations, :foreign_key => 'book1_id' + has_many :references, :through => :citations, :source => :reference_of, :uniq => true +end diff --git a/activerecord/test/fixtures/books.yml b/activerecord/test/fixtures/books.yml new file mode 100644 index 0000000000000..473663ff5bbb8 --- /dev/null +++ b/activerecord/test/fixtures/books.yml @@ -0,0 +1,7 @@ +awdr: + id: 1 + name: "Agile Web Development with Rails" + +rfr: + id: 2 + name: "Ruby for Rails" diff --git a/activerecord/test/fixtures/citation.rb b/activerecord/test/fixtures/citation.rb new file mode 100644 index 0000000000000..545aa8110d0dd --- /dev/null +++ b/activerecord/test/fixtures/citation.rb @@ -0,0 +1,6 @@ +class Citation < ActiveRecord::Base + belongs_to :reference_of, :class_name => "Book", :foreign_key => :book2_id + + belongs_to :book1, :class_name => "Book", :foreign_key => :book1_id + belongs_to :book2, :class_name => "Book", :foreign_key => :book2_id +end