Permalink
Browse files

Revert "More 1.9 way"

This reverts commit 675094b.
  • Loading branch information...
1 parent fd918fe commit 8350ce97f2065eed9638c595d3938a573d6fa343 @tenderlove tenderlove committed Jan 6, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 activemodel/lib/active_model/conversion.rb
@@ -39,9 +39,11 @@ def to_model
# Returns an Enumerable of all key attributes if any is set, regardless
# if the object is persisted or not.
+ #
+ # Note the default implementation uses persisted? just because all objects
+ # in Ruby 1.8.x responds to <tt>:id</tt>.
def to_key
- key = respond_to?(:id) && id
- key ? [key] : nil
+ persisted? ? [id] : nil
end
# Returns a string representing the object's key suitable for use in URLs,

0 comments on commit 8350ce9

Please sign in to comment.