From dcdfc84f55ea1a7880a30f63b6517745310d24eb Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 15 Nov 2010 14:35:28 -0800 Subject: use quoted id of single AR::Base objects in predicates --- activerecord/test/cases/relations_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index b44c716db8..13c26a0c15 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -426,6 +426,12 @@ class RelationTest < ActiveRecord::TestCase assert_blank authors.all end + def test_where_with_ar_object + author = Author.first + authors = Author.scoped.where(:id => author) + assert_equal 1, authors.all.length + end + def test_exists davids = Author.where(:name => 'David') assert davids.exists? -- cgit v1.2.3