MENUREADME | How to run locally | REST API doc | Web app screenshots
Eighteen versions (gradually implemented) of a Web and REST API app made with Ruby on Rails that aims to get the most out of the MVC/Rails Way.
| Branch | 040-models-within-namespaces |
| Lines of Code | 1359 |
| Rubycritic Score | 91.56 |
The previous versions already showed the benefits of organizing the codebase. This version goes further by grouping models within namespaces.
Beyond the code structure, check out the model's implementation to see how the associations reflect the namespace structure.
Here is the comparison of the models' directory structure (before and after):
| Before | After |
|---|---|
app/models ├── account.rb ├── application_record.rb ├── current.rb ├── membership.rb ├── task_item.rb ├── task_list.rb ├── user.rb └── user_token.rb | app/models ├── account.rb ├── application_record.rb ├── concerns ├── current.rb ├── membership.rb ├── task │ ├── item.rb │ └── list.rb ├── user │ └── token.rb └── user.rb |
Cohesion + consistency = maintainability.
Seven iterations have been since version 021-multi-controllers-per-entity_rest_actions_only, but the Rubycritic score has remained the same (91.56).
But what was the reason?
The same controllers handle both the web application and the REST API. In other words, there needs to be more cohesion since each request format serves different purposes.
Because of this, the next version will perform this separation, and with this, it will be possible to determine whether or not this care in promoting cohesion will improve the quality score.
Next version: 050-separation-of-entry-points.
To understand the project's context, I'd like you to please read the main branch's README.
Check out the:
- disclaimer to understand the project's purpose.
- summary of all branches.