openstreetmap / openstreetmap-website

The Rails application that powers OpenStreetMap
https://www.openstreetmap.org/
GNU General Public License v2.0
2.21k stars 918 forks source link

Adding map note tags - part 1 - added migration script and model files #5323

Open nenad-vujicic opened 1 week ago

nenad-vujicic commented 1 week ago

Description

Added migration for creating note_tags DB table, created model file NoteTag.rb, updated associations with Note class and added note_tag factory and unit tests NoteTagTests for testing basic functionalities (key/value lengths validity, key/value lengths invalidity, orphaned tags invalidity and note-tags uniqueness).

This PR is first step of adding support for map note tags described in #5294 and which fully implementation can be found here (decomposed to smaller because of simpler review).

How has this been tested?

Tested by running linters from lint.yml workflow, unit tests and by manually inserting note-tags manipulations and as part of complete implementation locally.