From 55385c8a39117f5c1b78fcb703f9d7ac14d97d12 Mon Sep 17 00:00:00 2001 From: Jon Moss Date: Thu, 11 Feb 2016 22:58:18 -0500 Subject: Fix issue #23625 This resolves a bug where if the primary key used is not `id` (ex: `uuid`), and has a `validates_uniqueness_of` in the model, a uniqueness error would be raised. This is a partial revert of commit `119b9181ece399c67213543fb5227b82688b536f`, which introduced this behavior. --- activerecord/test/models/uuid_item.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 activerecord/test/models/uuid_item.rb (limited to 'activerecord/test/models/uuid_item.rb') diff --git a/activerecord/test/models/uuid_item.rb b/activerecord/test/models/uuid_item.rb new file mode 100644 index 0000000000..2353e40213 --- /dev/null +++ b/activerecord/test/models/uuid_item.rb @@ -0,0 +1,6 @@ +class UuidItem < ActiveRecord::Base +end + +class UuidValidatingItem < UuidItem + validates_uniqueness_of :uuid +end -- cgit v1.2.3