public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/codafoo/rails.git
Fixed has_many_through association join building for legacy dbs
codafoo (author)
Mon Jun 30 23:40:29 -0700 2008
commit  7fcdf6c7d83ee65c3dc420284eb3b2c4f91a0255
tree    8aed607a3a9d04401ac935c260d0f5dcee535d27
parent  6f1d827096ad9f1044a6da7141e7ae720a64ec6b
...
148
149
150
151
 
152
153
154
...
148
149
150
 
151
152
153
154
0
@@ -148,7 +148,7 @@ module ActiveRecord
0
             end
0
           else
0
             reflection_primary_key = @reflection.source_reflection.primary_key_name
0
- source_primary_key = @reflection.klass.primary_key
0
+ source_primary_key = @reflection.through_reflection.klass.primary_key
0
             if @reflection.source_reflection.options[:as]
0
               polymorphic_join = "AND %s.%s = %s" % [
0
                 @reflection.quoted_table_name, "#{@reflection.source_reflection.options[:as]}_type",

Comments

    No one has commented yet.