Browse files

Revert "Merge pull request #13276 from aayushkhandelwal11/change_to_key"

This will call primary_key two times

This reverts commit d0588a2, reversing
changes made to 87e1e86.
  • Loading branch information...
1 parent 929c226 commit 5853c64a4ba77134b7a4ff942b7ae711cb7bcc46 @rafaelfranca rafaelfranca committed Dec 11, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 activemodel/lib/active_model/conversion.rb
View
3 activemodel/lib/active_model/conversion.rb
@@ -49,7 +49,8 @@ def to_model
# 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,

0 comments on commit 5853c64

Please sign in to comment.