jgaskins/perpetuity — pull request #28 by jgaskins (2013-05-02 05:56:07+00:00)
Title: Remove persisted object extension

The current behavior of inserting to and retrieving from the database includes extending the objects with `Perpetuity::PersistedObject`, which gives them an `id` method. It's basically just an attr_reader; the `@id` ivar is injected on insertion/retrieval.

Unfortunately, this smashes the method cache. This can [slow things down drastically](https://gist.github.com/jgaskins/5365357#file-results-md).

This PR allows you to use `Mapper#id_for(object)` instead of `object.id`. I'm not sure if this is the best way to handle it, but I figured I'd post it here for discussion.