]> git.openstreetmap.org Git - rails.git/commit
Report invalid trace tags against the tags field
authorvignesh-chaturvedi <vigneshchaturvedi@gmail.com>
Fri, 16 Oct 2026 18:52:41 +0000 (18:52 +0000)
committervignesh-chaturvedi <vigneshchaturvedi@gmail.com>
Mon, 19 Oct 2026 19:07:07 +0000 (00:37 +0530)
commitf035e383db84c6e976266da6f30df00d52193f89
tree39b127ea3a17c7ff02155a04fd6ca0be8808b8b3
parentfe5a25522cbbc237ae86806367162353283c24ea
Report invalid trace tags against the tags field

Validate the tags as part of the trace and report any problems against
the tag string, so that the upload and edit forms show what is wrong
next to the tags field, and return a 422 status when either form is
shown again with errors.

This means removing the tag's validation of its trace, as validating the
trace from each tag cleared the trace's errors, so a trace with an
invalid tag followed by a valid one was considered valid. The tag still
requires a trace, as belongs_to associations are required by default.
app/controllers/traces_controller.rb
app/models/trace.rb
app/models/tracetag.rb
test/controllers/traces_controller_test.rb
test/models/trace_test.rb