mountetna / magma

Data server with friendly data loaders
GNU General Public License v2.0
5 stars 2 forks source link

Load attributes from the attributes table #129

Closed graft closed 4 years ago

graft commented 4 years ago

When Magma boots, it calls Magma#load_models to attach to the database and make the data available via Sequel. The main thing this does is connect to the database, instantiate projects, load the project models, and validate the models.

All of this should continue; we wish to change only Magma::Project#load_project, which calls require_files('models'), which includes the models/ directory code in project-specific repos. Instead we wish to achieve the exact same result as this require operation - that is, we have a bunch of model classes < Magma::Model with the correct set of attribute definitions.

To make this change, we might replace require_files('models') with load_project_models, which reads the model definitions from the attributes table and constitutes a new set of magma models.