aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-09-07 02:11:21 -0700
committerJon Leighton <j@jonathanleighton.com>2012-09-07 02:11:21 -0700
commite20a790b9e63ff7ff71753b24bd88c0a62dc2cf7 (patch)
treed1e0b3d17d1c34baeb92a0f68ae43909e8675a9c /activerecord/test
parent1c1f65430046fa0041acc898d8d6f5377f20806e (diff)
parent07dad778d18b45eb6d6a003d3ba7cb8528e9c720 (diff)
downloadrails-e20a790b9e63ff7ff71753b24bd88c0a62dc2cf7.tar.gz
rails-e20a790b9e63ff7ff71753b24bd88c0a62dc2cf7.tar.bz2
rails-e20a790b9e63ff7ff71753b24bd88c0a62dc2cf7.zip
Merge pull request #4976 from kreynolds/fix_eager_without_pkey
Fix eagerly loading associations without primary keys
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/join_dependency_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/join_dependency_test.rb b/activerecord/test/cases/associations/join_dependency_test.rb
new file mode 100644
index 0000000000..08c166dc33
--- /dev/null
+++ b/activerecord/test/cases/associations/join_dependency_test.rb
@@ -0,0 +1,8 @@
+require "cases/helper"
+require 'models/edge'
+
+class JoinDependencyTest < ActiveRecord::TestCase
+ def test_column_names_with_alias_handles_nil_primary_key
+ assert_equal Edge.column_names, ActiveRecord::Associations::JoinDependency::JoinBase.new(Edge).column_names_with_alias.map(&:first)
+ end
+end \ No newline at end of file