mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
Tracks is a GTD™ web application, built with Ruby on Rails
https://www.getontracks.org/
This commit fixes the tag loading issue and adds comprehensive testing. ## Bug Fix: Polymorphic Tag Loading Fixed issue with many-to-many tag relationships not working correctly with polymorphic associations. The problem was that GORM doesn't support using `many2many` with polymorphic relationships directly. **Changes:** - Modified `internal/models/todo.go`: Changed Tags field to use `gorm:"-"` to skip GORM handling - Modified `internal/models/recurring_todo.go`: Same fix for recurring todos - Modified `internal/services/todo_service.go`: Added `loadTodoTags()` helper function to manually load tags through the taggings join table **How it works now:** 1. Tags are no longer automatically loaded by GORM 2. Manual loading via JOIN query: `tags JOIN taggings ON tag_id WHERE taggable_id AND taggable_type` 3. Called after loading todos in both `GetTodo()` and `GetTodos()` ## Testing Added `test_api.sh` - comprehensive integration test script that tests: 1. Health check 2. User registration 3. Authentication 4. Context creation 5. Project creation 6. Todo creation with tags 7. Listing todos with filters 8. Completing todos 9. Project statistics All tests pass successfully! ## Files Changed - `internal/models/todo.go`: Fix tag relationship - `internal/models/recurring_todo.go`: Fix tag relationship - `internal/services/todo_service.go`: Add manual tag loading - `test_api.sh`: New integration test script - `go.sum`: Updated with exact dependency versions |
||
|---|---|---|
| .github | ||
| app | ||
| bin | ||
| cmd/tracks | ||
| config | ||
| db | ||
| doc | ||
| internal | ||
| lib | ||
| log | ||
| public | ||
| script | ||
| test | ||
| test-envs | ||
| vendor/assets | ||
| .codeclimate.yml | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .rubocop.yml | ||
| .ruby-version | ||
| .yardopts | ||
| config.ru | ||
| CONTRIBUTING.md | ||
| COPYING | ||
| docker-compose.yml | ||
| docker-entrypoint.sh | ||
| Dockerfile | ||
| Gemfile | ||
| Gemfile.lock | ||
| go.mod | ||
| go.sum | ||
| mkdocs.yml | ||
| Rakefile | ||
| README.md | ||
| README_GOLANG.md | ||
| SECURITY.md | ||
| test_api.sh | ||
Tracks: a GTD™ compatible web application built with Ruby on Rails
About
- Project homepage: http://www.getontracks.org/
- Manual: http://www.getontracks.org/manual/
- Source at GitHub: https://github.com/TracksApp/tracks
- Hosted services: https://github.com/TracksApp/tracks/wiki/Hosted-Tracks
- Bug reports and feature requests: https://github.com/TracksApp/tracks/issues
- Mailing list: http://groups.google.com/group/TracksApp
- License: See COPYING
Full instructions for both new installations and upgrades from older installations of Tracks can be found in the wiki.
As always, make sure that you take sensible precautions and back up all your data frequently, taking particular care when you are upgrading.
Enjoy being productive!
Contributors and consulting
- Original developer: bsag (http://www.rousette.org.uk/)
- Principal maintainer: Jyri-Petteri ”ZeiP” Paloposki
(sponsored by Ardcoras oy, also available for paid consulting)
- If you want to support the maintainer's work, subscribe to the hosted version.
- Contributors: https://github.com/TracksApp/tracks/wiki/Contributors
If you are thinking about contributing towards the development of Tracks, please read /CONTRIBUTING.md for general information. Also you can find some information on development, testing and contributing on the wiki.