From 5853c64a4ba77134b7a4ff942b7ae711cb7bcc46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 11 Dec 2013 13:43:28 -0200 Subject: Revert "Merge pull request #13276 from aayushkhandelwal11/change_to_key" This will call primary_key two times This reverts commit d0588a2e897d33c6c12e9fc5f8680328d37a26ca, reversing changes made to 87e1e86640fb8b5a260ff7c0044aaae58fff2bc4. --- activemodel/lib/active_model/conversion.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/activemodel/lib/active_model/conversion.rb b/activemodel/lib/active_model/conversion.rb index bfceb23852..21e4eb3c86 100644 --- a/activemodel/lib/active_model/conversion.rb +++ b/activemodel/lib/active_model/conversion.rb @@ -49,7 +49,8 @@ module ActiveModel # person = Person.create # person.to_key # => [1] def to_key - [id] if respond_to?(:id) && id + key = respond_to?(:id) && id + key ? [key] : nil end # Returns a +string+ representing the object's key suitable for use in URLs, -- cgit v1.2.3