diff options
author | Gabe da Silveira <gabe@websaviour.com> | 2009-08-09 12:53:22 -0700 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-08-10 00:30:44 +0100 |
commit | 00d6c766608f90ce64f11feb98786cbc7f71b89d (patch) | |
tree | facb90eba8022d93b0cc9c3aba566694617ce583 /activerecord/lib/active_record/reflection.rb | |
parent | 810b59a2a9da3e85bc85d2617ae781c1b3645af4 (diff) | |
download | rails-00d6c766608f90ce64f11feb98786cbc7f71b89d.tar.gz rails-00d6c766608f90ce64f11feb98786cbc7f71b89d.tar.bz2 rails-00d6c766608f90ce64f11feb98786cbc7f71b89d.zip |
Enable has_many :through for going through a has_one association on the join model [#2719 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 0baa9654b7..db5d2b25ed 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -314,7 +314,7 @@ module ActiveRecord raise HasManyThroughAssociationPolymorphicError.new(active_record.name, self, source_reflection) end - unless [:belongs_to, :has_many].include?(source_reflection.macro) && source_reflection.options[:through].nil? + unless [:belongs_to, :has_many, :has_one].include?(source_reflection.macro) && source_reflection.options[:through].nil? raise HasManyThroughSourceAssociationMacroError.new(self) end |