Skip to content

Commit

Permalink
Revert "More 1.9 way"
Browse files Browse the repository at this point in the history
This reverts commit 675094b.
  • Loading branch information
tenderlove committed Jan 6, 2012
1 parent fd918fe commit 8350ce9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions activemodel/lib/active_model/conversion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8350ce9

Please sign in to comment.