Also, treat unrecognized flavor as standard flavor, instead of if trying to handle it as an error. This is only on the create view, actual submissions will raise an error for invalid flavor. You can only get the invalid flavor by manually changing the URL, so there doesn't seem to be a need to make it an error, and treating it as an error complicates the logic.
23 lines
463 B
Ruby
23 lines
463 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Clover
|
|
hash_branch(:project_prefix, "postgres") do |r|
|
|
r.get true do
|
|
postgres_list
|
|
end
|
|
|
|
r.web do
|
|
r.post true do
|
|
handle_validation_failure("postgres/create")
|
|
check_visible_location
|
|
postgres_post(typecast_params.nonempty_str("name"))
|
|
end
|
|
|
|
r.get "create" do
|
|
authorize("Postgres:create", @project.id)
|
|
view "postgres/create"
|
|
end
|
|
end
|
|
end
|
|
end
|