Skip to content

Commit

Permalink
More 1.9 way
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jan 5, 2012
1 parent 0e8dda7 commit 675094b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions activemodel/lib/active_model/conversion.rb
Expand Up @@ -39,11 +39,9 @@ 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
persisted? ? [id] : nil
key = respond_to?(:id) && id
key ? [key] : nil
end

# Returns a string representing the object's key suitable for use in URLs,
Expand Down

2 comments on commit 675094b

@tenderlove
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bro, this commit breaks the ActionPack build. I've reverted for now, can you please investigate?

@spastorino
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tenderlove thanks bro ❤️, fixed fc95642

Please sign in to comment.