简体   繁体   中英

DataMapper model in a rails mountable engine?

I'm building a mountable engine.

From a basic install, I've moved my existing application into the engine namespace.

The engine starts, but I've getting error messages because there are no tables in a db for the controller to reference.

  • How do I get my models in a database from the engine?
  • How can I test this with the provided dummy app?

I looked into dm-migrations, but I've yet to use that with DataMapper, so I'm sort of in clueless, uncharted waters. Giant question marks and all that. I'll poke around, but there is nothing through a search that is useful, right now.

Here is the application I'm playing with: http://github.com/blueblank/Ticket-Engine

The simple and straight forward answer is to create a generator that copies the models to the main app. That is it and simple, though looking at it in the long run, having the dm models in the engines app/models folder as the only prerequisite for installing models to an application from an engine (or mountable engine) would be fantastic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM