3

I've started using DataMapper in my project, then I've found out that it is actually a frozen project. DataMapper 2.0 moved to ROM (Ruby Object Mapper), however the Property API from DataMapper was extracted to Virtus project.

What I need is to keep definition of particular class in one place (relationship + attributes) and I cannot allow to keep model in schema definition prior to the class as it breaks low level requirements for the project. I need to map classes to model (way of persistence), not model to classes.

So, I start wonder if there is any way to glue Virtus and Sequel or ROM together, to have attributes definitions in same class declaration and get the database schema automatically as I would in DataMapper. I am looking at direction how can I hook to Virtus machinery and add schema to model by DB.create_table() (Sequel)... or something similar.

Please avoid answers and comments that are not hints how to do that. If it is not possible, I just remove DataMapper and abandon ORM then and instead I will create repository of marshaled objects.

Michał Fita
  • 1,113
  • 1
  • 9
  • 22

0 Answers0