diff options
author | Kelley Reynolds <kelley@insidesystems.net> | 2012-02-09 13:51:40 -0500 |
---|---|---|
committer | Kelley Reynolds <kelley@insidesystems.net> | 2012-02-09 13:51:40 -0500 |
commit | 6050d0177c3b9dc11c3e3c3dfa17530e27d90996 (patch) | |
tree | 749d9f1413d6c1c5602cea04c3af07c1cc0e98c7 /activerecord/lib | |
parent | b02c87ef2a22f01b4dcaae2663ed64284880b8fc (diff) | |
download | rails-6050d0177c3b9dc11c3e3c3dfa17530e27d90996.tar.gz rails-6050d0177c3b9dc11c3e3c3dfa17530e27d90996.tar.bz2 rails-6050d0177c3b9dc11c3e3c3dfa17530e27d90996.zip |
Fix eagerly loading associations without primary keys
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency/join_part.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency/join_part.rb b/activerecord/lib/active_record/associations/join_dependency/join_part.rb index 2b1d888a9a..711f7b3ce1 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_part.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_part.rb @@ -54,7 +54,7 @@ module ActiveRecord unless @column_names_with_alias @column_names_with_alias = [] - ([primary_key] + (column_names - [primary_key])).each_with_index do |column_name, i| + ([primary_key] + (column_names - [primary_key])).compact.each_with_index do |column_name, i| @column_names_with_alias << [column_name, "#{aliased_prefix}_r#{i}"] end end |