Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "More 1.9 way"

This reverts commit 675094b.
  • Loading branch information...
commit 8350ce97f2065eed9638c595d3938a573d6fa343 1 parent fd918fe
@tenderlove tenderlove authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 activemodel/lib/active_model/conversion.rb
View
6 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,
Please sign in to comment.
Something went wrong with that request. Please try again.