diff options
author | Jon Leighton <j@jonathanleighton.com> | 2010-12-19 14:17:29 +0000 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-23 15:19:17 -0800 |
commit | c6db37e69b1ff07f7ad535d4752d0e6eb2d15bff (patch) | |
tree | 1f9540d4f14cf67b1277d8e7cd1f658561a79831 /activerecord/test/models/author.rb | |
parent | d6efd3cfc2c6d6822aeac550852c49135fbe46c7 (diff) | |
download | rails-c6db37e69b1ff07f7ad535d4752d0e6eb2d15bff.tar.gz rails-c6db37e69b1ff07f7ad535d4752d0e6eb2d15bff.tar.bz2 rails-c6db37e69b1ff07f7ad535d4752d0e6eb2d15bff.zip |
Don't allow a has_one association to go :through a collection association [#2976 state:resolved]
Diffstat (limited to 'activerecord/test/models/author.rb')
-rw-r--r-- | activerecord/test/models/author.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb index fd6d2b384a..244c5ac4f5 100644 --- a/activerecord/test/models/author.rb +++ b/activerecord/test/models/author.rb @@ -28,7 +28,9 @@ class Author < ActiveRecord::Base has_many :first_posts has_many :comments_on_first_posts, :through => :first_posts, :source => :comments, :order => 'posts.id desc, comments.id asc' - has_one :comment_on_first_posts, :through => :first_posts, :source => :comments, :order => 'posts.id desc, comments.id asc' + + has_one :first_post + has_one :comment_on_first_post, :through => :first_post, :source => :comments, :order => 'posts.id desc, comments.id asc' has_many :thinking_posts, :class_name => 'Post', :conditions => { :title => 'So I was thinking' }, :dependent => :delete_all has_many :welcome_posts, :class_name => 'Post', :conditions => { :title => 'Welcome to the weblog' } |