aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relations_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-01-03 22:47:07 +0000
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-03 16:24:32 -0800
commit2120da7f733ba33183a42e71256db9652c5f5fcc (patch)
treedc27550f28c65c872d5b5fda8813cacf3746fe1b /activerecord/test/cases/relations_test.rb
parent0619dc2319cf839977ea9670a52d9280a1af3595 (diff)
downloadrails-2120da7f733ba33183a42e71256db9652c5f5fcc.tar.gz
rails-2120da7f733ba33183a42e71256db9652c5f5fcc.tar.bz2
rails-2120da7f733ba33183a42e71256db9652c5f5fcc.zip
ActiveRecord::Relation#primary_key should return a string, just like ActiveRecord::Base.primary_key does.
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r--activerecord/test/cases/relations_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index 4de180880c..5018b16b67 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -810,4 +810,8 @@ class RelationTest < ActiveRecord::TestCase
def test_removing_limit_with_options
assert_not_equal 1, Post.limit(1).all(:limit => nil).count
end
+
+ def test_primary_key
+ assert_equal "id", Post.scoped.primary_key
+ end
end