jgaskins / perpetuity

Persistence gem for Ruby objects using the Data Mapper pattern
http://jgaskins.org/blog/2012/04/20/data-mapper-vs-active-record/
MIT License
250 stars 14 forks source link

Extract mapper registry #14

Closed jgaskins closed 11 years ago

jgaskins commented 11 years ago

The Mapper class currently keeps track of all mappers. Instead, we should extract that functionality into a MapperRegistry and keep Mapper as a base class for defining attributes to serialize to the DB.

This will make several things easier, as well. For example, in #10, I had circular dependencies due to mappers instantiating serializers which would then need to get attribute lists from Mapper. If we extract this, the serializers won't depend on Mapper to get information about other mappers, they'll both instead rely on MapperRegistry.

jgaskins commented 11 years ago

Fixed in 7ad662e5c0154821c7aa03bc9520523fb0a33cb9