Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit cf3e9664a41b8137556b53efc1b1dbaeae68c079 1 parent 1117d73
@jeremy jeremy authored
View
4 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
View
7 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"
View
6 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
Please sign in to comment.
Something went wrong with that request. Please try again.