However, do not allow creation of objects in internal locations in web/api routes. Show helpful error message if using an invalid location in the api. This error message shows what the problem is, and the available valid locations the user can use.
11 lines
300 B
Ruby
11 lines
300 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Clover
|
|
hash_branch(:project_prefix, "location") do |r|
|
|
r.on String do |location_display_name|
|
|
handle_invalid_location unless (@location = Location[display_name: location_display_name])
|
|
r.hash_branches(:project_location_prefix)
|
|
end
|
|
end
|
|
end
|