datamapper/dm-core — Issue #175: Models in Rails Engines Erroring (1.2.0, I think)
Author: jkestr
Created: 2012-01-14 00:49:18+00:00
State: open

I've been running into an issue with existing models and engines I have built from previous versions of DataMapper.

It appears with 1.2.0, it is no longer possible to have models inside of an engine without explicitly calling #finalize on each model. Is this a known issue, and if so are there any work arounds?

DataMapper.finalize does not work in this context, as it does not see the models inside of the engines. I tried creating an initializer that calls finalize on each model, but I ran into issues with Devise not yet being loaded.

What did work was putting .finalize at the bottom of each model definition, but I would rather not have to do that, and I am sure it would only cause other issues with relationships and such.