-
Notifications
You must be signed in to change notification settings - Fork 3
Implementation Details and Implementation Workflow
All models of Ontohub are defined in the ontohub-models Rails engine.
The corresponding specs, fixtures and factories are located in the spec
directory of that repository.
Every time the models gem changes, we need to update the reference to the desired commit in the Gemfile of ontohub-backend and bundle update ontohub_models
.
This Rails engine enables sharing of the database migrations, such that they don't have to be copied to the app that uses the engine.
To run the migrations for the host app, execute rails db:migrate
as usual.
To create a new model with a generator, you can just run, for example,
rails g model Repository name:string slug:string description:text created_at:datetime updated_at:datetime
which creates a Sequel model (without any plugins), a factory and a spec file.
Sometimes, we need to add temporary code that must be included in a near-production or production state but removed some time later.
In this case, add a code-comment leading with the keyword TEMPORARY
with an optional short description of when this is supposed to be removed.
Right after merging the pull request, add an issue to delete the temporary code referencing the temporary lines of code (at the merge commit).