aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-11-23 14:58:10 -0500
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-23 14:33:00 -0800
commitd33dcba72d19beffc4a359f2fb89659f24122e9a (patch)
tree1f72b6c88a6714ecc9fe9ac90cad5bd4ee0b65c8 /activerecord/test
parent0456feab1198456069d4b5a9da221e6fd818e3da (diff)
downloadrails-d33dcba72d19beffc4a359f2fb89659f24122e9a.tar.gz
rails-d33dcba72d19beffc4a359f2fb89659f24122e9a.tar.bz2
rails-d33dcba72d19beffc4a359f2fb89659f24122e9a.zip
Do not send id for quoting twice if the primary key is string.
[#6022 state:resolved]
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relations_test.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index 535bcd4396..1682f34a1d 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -14,11 +14,18 @@ require 'models/bird'
require 'models/car'
require 'models/engine'
require 'models/tyre'
+require 'models/minivan'
class RelationTest < ActiveRecord::TestCase
fixtures :authors, :topics, :entrants, :developers, :companies, :developers_projects, :accounts, :categories, :categorizations, :posts, :comments,
- :tags, :taggings, :cars
+ :tags, :taggings, :cars, :minivans
+
+ def test_do_not_double_quote_string_id
+ van = Minivan.last
+ assert van
+ assert_equal van.id, Minivan.where(:minivan_id => van).to_a.first.minivan_id
+ end
def test_bind_values
relation = Post.scoped